Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Closing Tag of Figures Without Captions in Ordered and Unordered Lists #2697

Merged
merged 1 commit into from
Oct 28, 2020
Merged

Commits on Sep 18, 2020

  1. Fix closing tag of figures without captions in lists

    When the figure helper is used in a list, which can be either ordered or
    unordered, and no caption is specified, a line with text "</figure>"
    will be shown below the figure on the rendered page.
    
    This is because, if the '{% if include.caption %}' evaluates to false,
    the lines between that 'if' statement and '{% endif %}' will be emptied,
    not removed, so the block will be filled by empty lines.
    
    HTML ignores redundant empty lines, but Markdown takes them seriously.
    In addition, Markdown expects proper indentation of lines inside lists,
    and the closing '</figure>' tag is not indented.  When combined, the
    empty space and absence of indentation cause Markdown to process the
    '</figure>' tag as a separate paragraph instead of an HTML tag, thus the
    text for the tag is directly rendered on the page.
    
    The fix for this issue is very simple: remove the empty space when
    'include.caption' is false.  As described in
    <https://shopify.github.io/liquid/basics/whitespace/>, this can be done
    by adding hyphens to the 'if' and 'endif' tags.
    Leo3418 committed Sep 18, 2020
    Configuration menu
    Copy the full SHA
    f98aacb View commit details
    Browse the repository at this point in the history