Repository navigation
Conversation
A list item which directly followed an indented paragraph or nested list of the previous item, without a blank line between them, was treated as a lazy continuation line of that block (Python-Markdown#845). `ListIndentProcessor` now splits the block before the first unindented line which starts another item of the list. The registered list processors decide what counts as an item, so `sane_lists` still treats a marker of the other list type as text. Other unindented lines remain lazy continuations. As no blank line comes before them, the split off items continue the list as tight items: a `listcontinue` parser state tells `OListProcessor` not to make the first of them loose. They are parsed like any list block at that level, so a horizontal rule or header after them now ends the list, as it already does at the top level. Fixes Python-Markdown#845.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #845.
When a list item comes right after an indented paragraph or nested list of the previous item, with no blank line in between, it was swallowed into that paragraph as a lazy continuation line.
ListIndentProcessornow ends the indented block at the first unindented line that starts another item of the same list. Those items continue the list as tight items, because no blank line comes before them (the same as Markdown.pl).Unchanged:
First line of a paragraph/- second lineexample from the issue.sane_lists, a marker of the other list type is still treated as text.One behaviour change: a horizontal rule or header right after those items now ends the list, the same as it already does for a list at the top level. Before, it ended up inside the previous item.
Not covered:
def_list.I'm happy to look at those separately.
AI Assistance Disclosure
No AI tools were used in preparing this PR.
AI tools were used and I have disclosed which ones, and have fully reviewed and verified their output.
AI tools were use to assist with the following:
Checklist