Closed goofpunk closed 11 months ago
I noticed another, much more minor issue recently, that I think is related: if I mix regular HTML headings in with the Markdown, they don't get picked up in the table of contents. Are all of the extras being run before the main markdown conversion process? That could lead to both of these bugs.
Are all of the extras being run before the main markdown conversion process?
The table of contents extra is run when converting MD headers to HTML. I think most extras are run that way as well.
For this specific issue, I guess we could do basic parsing of the h[1-6]
tags, add them to the TOC and then sort by the line number, since h[1-6]
tags are block level.
Notes should be in the order they were numbered.
Could probably apply the same "sort in order of appearance" logic to this. Not sure if footnotes are considered "block level" so might have to secondary sort by column as well.
I'll look into both of these at some point
I've created a PR that fixes the main point of this issue, which is footnote ordering. Footnotes will now appear in the same order that they are defined. This behaviour is in line with what python-markdown does (couldn't find explicit docs but I tested it locally).
For the headers issue, I've spun it off into a separate issue (#537) and I'll try to look at it soon
Describe the bug If you include footnotes in a list (whether ordered or unordered), the footnotes that are in the list get numbered first, and are at the top of the list at the bottom of the HTML output.
To Reproduce
Expected behavior Notes should be in the order they were numbered. Instead, the results (in both the numbering and the list at the bottom) are:
Debug info Version of library being used: 2.4.10
Any extras being used: reproducible with no extras other than footnotes