Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heading in list #1436

Merged
merged 3 commits into from
Jan 29, 2024
Merged

Heading in list #1436

merged 3 commits into from
Jan 29, 2024

Conversation

waylan
Copy link
Member

@waylan waylan commented Jan 22, 2024

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

This is a weird edge case. Normally, detabbing would be handled by
the `ListIndentProcessor`. However, in this one case, that class's
`get_level` method would need to return a different result than in
any other case. As there is no way to easily determine this specific
case from that class, we make the adjustment directly in the
`HashHeaderProcessor` class. Fixes Python-Markdown#1433.
@waylan
Copy link
Member Author

waylan commented Jan 23, 2024

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.

@waylan waylan marked this pull request as ready for review January 23, 2024 15:24
@waylan waylan merged commit c334a3e into Python-Markdown:master Jan 29, 2024
17 checks passed
@waylan waylan deleted the 1433 branch January 29, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant