Open konobi opened 8 years ago
Here's a simpler case:
* one
* two
* three
* four
* new
Insert a comment (which isn't displayed) after the first list and the problem will disappear.
Note how github renders it, with the same problem:
Here's a screenshot:
@Jmuccigr Are you trying to create a new list with three blank line? According to CommonMark, this shouldn't interrupt the original list. This works:
* one
* two
* three
Below is a new list.
* one again
* two again
* three again
I think the point is that the spacing is too large between three and four when four is itself followed by a blank line or two. Switch to numbered lists and you can see that the list is intact, but the spacing is odd:
1. one
1. two
1. three
1. four
1. new
becomes
where, to be clear, thereʻs extra space between three and four.
Looking at the markdown syntax though, I think this is the expected behavior and itʻs from this bit:
If list items are separated by blank lines, Markdown will wrap the items in
<p>
tags in the HTML output.
So four gets wrapped in <p>
, even though itʻs followed and not preceded by a blank line. pandoc does this too.
The original Markdown syntax missed a lot of corner cases like this; that's why I suggested to refer to CommonMark.
Yes, in the pandoc output from common mark, all the items get wrapped with <p>
when there's a single blank line in the list, instead of just some of them. It seems that the observed behavior is considered correct for non-Commonmark though.
Well, for non-CommonMark, there are a lot of "correct" behavior. Authors of every editor/renderer just implemented what they consider the correct behavior. I am considering to open another issue to discuss whether we should move our syntax to (a super set of) CommonMark, so that we actually have something to refer to. @Jmuccigr @konobi any ideas?
@Jmuccigr Sorry, I misinterpreted what you meant until I reviewed your comments today. Now I fully agree with you: given
1. one
1. two
1. three
1. four
1. new
MacDown should have rendered
<ol>
<li>
<p>one</p>
</li>
<li>
<p>two</p>
</li>
<li>
<p>three</p>
</li>
<li>
<p>four</p>
</li>
<li>
<p>new</p>
</li>
</ol>
but now it rendered
<ol>
<li>one</li>
<li>two</li>
<li>three</li>
<li>
<p>four </p>
</li>
<li>
<p>new</p>
</li>
</ol>
instead. This behavior is reproducible with Hoedown.
"Expected behavior" concluded from CommonMark:
A list is loose if any of its constituent list items are separated by blank lines, or if any of its constituent list items directly contain two block-level elements with a blank line between them.
so "being loose" is not a property of a list item, but the entire list.
I have rendering issues with the following:
The spacing between the list items in the lists after the first list is way too wide. Should be able to see it for yourself, if not, let me know and I'll add a screenshot. Reporting version:
Macdown: Version 0.6 (749)