Python-Markdown / markdown

A Python implementation of John Gruber’s Markdown with Extension support.
https://python-markdown.github.io/
BSD 3-Clause "New" or "Revised" License
3.71k stars 856 forks source link

Heading in list #1436

Closed waylan closed 7 months ago

waylan commented 7 months ago

Here is a start at a fix for #1433. So far I have tests, one of which is failing.

waylan commented 7 months ago

This is ready to go. Turns out the first item in a list was being parsed differently because the list parser does not look ahead and it doesn't know it is in a loose list until it gets to the second list item. The fix here just detects that its in the second (or later) item and adjusts the content after the heading (by detabbing it) so that it gets parsed correctly. See the commit message for 3fca127 for more details.