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

List parsing affected by number of blank lines at end #56

Closed
jgm opened this issue Aug 5, 2020 · 2 comments
Closed

List parsing affected by number of blank lines at end #56

jgm opened this issue Aug 5, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@jgm
Copy link
Owner

jgm commented Aug 5, 2020

See jgm/pandoc#6589

% commonmark
- a
  - b
  - c
^D
<ul>
<li>a
<ul>
<li>b
</li>
<li>c
</li>
</ul>
</li>
</ul>
% commonmark
- a
  - b
  - c



^D
<ul>
<li>a
<ul>
<li>
<p>b</p>
</li>
<li>
<p>c</p>
</li>
</ul>
</li>
</ul>
@jgm
Copy link
Owner Author

jgm commented Aug 5, 2020

Here is the culprit:

         let blanksAtEnd = case blanks of
                                     (l:_) -> l >= curline - 1
                                     _     -> False
            let blanksInside = case length blanks of
                                  n | n > 1     -> True
                                    | n == 1    -> not blanksAtEnd
                                    | otherwise -> False

This assumes at most one blank line at the end.

@jgm
Copy link
Owner Author

jgm commented Aug 5, 2020

We were doing removeConsecutive which will remove runs of 2+ blank lines for this test.
However, the test for a blank at end fails after this. Should be easy to fix.

@jgm jgm closed this as completed in cfaa850 Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant