Open martinhath opened 2 months ago
This markdown:
- one - two Next line
should have the same output as this:
but it doesn't.
The output of the first snippet is (as expected)
<ul> <li>one</li> <li>two</li> </ul> <p>Next line</p>
but the output of the second snippet is
<ul> <li> <p>one</p> </li> <li> <p>two</p> </li> </ul> <p>Next line</p>
which is not expected. The <p> tags should probably not be there.
<p>
Here's a failing test
#[test] fn two_blank_lines_inserts_paragraphs() { let out = to_html("- one\n- two\nNext line"); assert!(!out.contains("<p>one</p>")); // Passes let out = to_html("- one\n- two\n\nNext line"); assert!(!out.contains("<p>one</p>")); // Passes let out = to_html("- one\n- two\n\n\nNext line"); assert!(!out.contains("<p>one</p>")); // Fails 💥 }
looks like the loose/tight/spread algorithm is taking the line endings after the list/last item into account, where it should only look internally.
This markdown:
should have the same output as this:
but it doesn't.
The output of the first snippet is (as expected)
but the output of the second snippet is
which is not expected. The
<p>
tags should probably not be there.Here's a failing test