Unordered lists not working when there is no newline between list items and preceding text
jluxenberg opened this issue · 2 comments
jluxenberg commented
Consider this markdown:
Some items:
- foo
- bar
We expect this:
Some items:
- foo
- bar
But no unordered list is produced in this case, instead we get this output:
In [23]: s8 = """
...: Some items:
...: - foo
...: - bar
...: """
In [25]: print(markdown2.markdown(s8))
<p>Some items:
- foo
- bar</p>
Attached is a patch to add a test case to test/markdowntest-cases/Ordered and unordered lists.text
2023-06-26_jluxenberg-add-test-case-for-unordered-list.patch.
I don't have time to dig into a solution right now, but might have time later in the week. Let me know if a patch would be accepted; this does seem to be a bug -- all of the other Markdown tools I've tried parse this correctly (included here on Github).
Crozzers commented
Hi there! Have you tried the cuddled lists extra?
jluxenberg commented
Hi there! Have you tried the cuddled lists extra?
Ah thank you, that works!
In [26]: print(markdown2.markdown(s8, extras=["cuddled-lists"]))
<p>Some items:</p>
<ul>
<li>foo</li>
<li>bar</li>
</ul>
Closing.