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 list tightness. #269

Merged
merged 1 commit into from
Aug 8, 2023
Merged

Commits on Aug 7, 2023

  1. Fix list tightness.

    According to the specification, blank lines in a block quote doesn't
    separate list items:
    https://spec.commonmark.org/0.30/#example-320
    
    Therefore, the following example should be tight:
    
    - > - a
      >
    - b
    
    The specification also say that link reference definitions can be
    children of list items when checking list tightness:
    https://spec.commonmark.org/0.30/#example-317
    
    Therefore, the following example should be loose:
    
    - [aaa]: /
    
      [bbb]: /
    - b
    
    This commit fixes those problems with the following strategy:
    
    - Using source end position and start position of adjoining elements to
      check tightness.
      This requires adjusting source end position of some block types to
      exclude trailing blank lines.
    
    - Delaying removal of link reference definitions until the entire document is
      parsed.
    taku0 committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    d1d3d17 View commit details
    Browse the repository at this point in the history