fix: number nested-block footnotes in document order - #1626
Open
BetterAndBetterII wants to merge 2 commits into
Open
fix: number nested-block footnotes in document order#1626BetterAndBetterII wants to merge 2 commits into
BetterAndBetterII wants to merge 2 commits into
Conversation
With USE_DEFINITION_ORDER=False, footnote refs were numbered by breadth-first inline walk order, so refs inside lists/blockquotes got wrong superscripts. Rebuild footnote_order from the tree in document order and renumber refs before reordering the footnote list. Fixes Python-Markdown#1561
Member
|
You seem to have deleted the pull request template from your submission. Could you please copy that into a comment and provide the requested information before we use our time to review your submission? |
Satisfy changelog-enforcer and checkspelling for the Python-Markdown#1561 footnote order fix.
Member
|
This appears to be a bug-fix, not an enhancement. Therefore, the feature freeze on extensions does not apply. However, I will not review this any further until the requested information is provided. Specifically, we would like to know about any AI use which may or may not have contributed to this PR. |
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.
Summary
With
USE_DEFINITION_ORDER=False, footnote reference numbers followed the breadth-first inline parse order rather than source/document order. Refs inside lists and blockquotes therefore got the wrong superscripts (e.g. 1, 4, 2, 5, 3 instead of 1–5).This rebuilds
footnote_orderfrom the already-rendered tree in document order, renumbers the superscripts, then reorders the footnote list — without changing core inline walking.Fixes #1561
Test plan
python -m unittest tests.test_syntax.extensions.test_footnotes(28 OK)