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

Fix footnote labels appearing out-of-order (#536) #612

Merged
merged 2 commits into from
Dec 7, 2024

Conversation

Crozzers
Copy link
Contributor

@Crozzers Crozzers commented Dec 7, 2024

This PR follows up on a comment on #536 that shows that the footnote labels are appearing out-of-order, even though the footnote links themselves are accurate. This bug was due to the out-of-order processing of some markdown elements and the order of insertion into the footnote_ids list.

Example:

one [^1]

- two [^2]


[^1]: one
[^2]: two

The footnote label is inserted as each footnote is processed. However, the list is processed first, which means its footnote is processed firstthat it is given the label of 1 mistakenly.

This PR fixes that by instead inserting a placeholder here, and then postprocessing the entire text top-to-bottom, which fixes the labelling.

@nicholasserra
Copy link
Collaborator

Thank you!

@nicholasserra nicholasserra merged commit 1032d35 into trentm:master Dec 7, 2024
15 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