Skip to content

Preserve numbers for repeated footnote references - #727

Merged
nicholasserra merged 1 commit into
trentm:masterfrom
jakezwang:fix/repeated-footnote-labels
Sep 20, 2026
Merged

nicholasserra merged 1 commit into
trentm:masterfrom
jakezwang:fix/repeated-footnote-labels

Conversation

@jakezwang

Copy link
Copy Markdown
Contributor

Repeated references to a footnote currently use the total number of footnotes encountered, so [^first], [^second], [^first] produces labels 1, 2, 2.

Remember each footnote's assigned number independently of the list used to order definitions. This also keeps labels consistent for nested references when definitions appear in a different order.

Adds regression coverage for repeated references in paragraphs, lists and footnotes, reversed definition order, and reuse of a Markdown instance. Existing footer ordering is preserved.

Validation: make testone (285 tests) and make testredos (7 tests) pass on Python 3.9–3.14. No new pycodestyle diagnostics compared with the base revision.

@nicholasserra

Copy link
Copy Markdown
Collaborator

Thanks!

@nicholasserra
nicholasserra merged commit db58ad8 into trentm:master Sep 20, 2026
18 checks passed
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.

2 participants