Lists with line breaks are not parsed correctly #2779
Labels
category: lists
L2 - annoying
Similar to L1 - broken but there is a known workaround available for the issue
Marked version:
4.3.0
4.2.3
Describe the bug
👋Hello. I am using marked and it is a great library, thank you for creating it.
According to this discussion, V4.2.3 is supposed to be 100% compliant with the "Lists" and "List items" of the CommonMark standard. However, it seems to have some issues with parsing lists that contain line breaks, such as the following:
To Reproduce
Steps to reproduce the behavior:
(3 list items)
(an empty list item and a
<p>
)Expected behavior
I believe that parsing it in the following way, like in CommonMark, is correct:
Explanation
According to CommonMark 5.2 List items:
1.
is a list item with empty content.W
of the list marker (1.
) is2
, so in order forMonday
to become the content of1.
, it needs to have3
(=W + 1
) or more spaces of indentation. In the given example, since there are0
spaces,Monday
should become regular text (<p>
).Example1:
Expected result:
Example2:
Expected result:
The text was updated successfully, but these errors were encountered: