Fix multilevel lists#463
Merged
nicholasserra merged 3 commits intotrentm:masterfrom Aug 16, 2022
Merged
Conversation
| <ul> | ||
| <li>Em Nuvem (cloud based)</li> | ||
| <li>Em Nuvem (cloud based) | ||
| <ul> |
Collaborator
There was a problem hiding this comment.
Doing a quick look at this and it seems wrong because the LIs arent closing. But i'm guessing this is intentional? UL should be nested under the LI before it's closed?
Contributor
Author
There was a problem hiding this comment.
The Mozilla docs on nesting lists give an example where the nested <ul> is placed as a child of the <li> before closing and I also found this stackoverflow answer that confirms this
Collaborator
|
Thank you! |
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.
This PR fixes #275. The issue was that lists with multiple levels of nesting were being flattened. For example:
Would become:

Which is obviously wrong. The bug came from the following line in the
_list_item_subfunction:python-markdown2/lib/markdown2.py
Line 1801 in 6032f8b
Once the above example reaches this line it is then outdented to:
Which now just resembles a normal list and will be processed as such.
This PR changes the
_list_item_subfunction to use the_uniform_outdentfunction, which produces the following output at the same point in the program, allowing nesting to be preserved.Whilst working on this bug I also discovered that the break_on_newline_excessive_br_tags test case, added in PR #422, contained incorrect list nesting.

This PR also fixes that test case.