Skip to content

Footnotes numbering #1367

Open
Open
@alexvoss

Description

The numbering of footnotes follows the order in which the footnotes are defined rather than the order in which they are referenced in the document. This is somewhat surprising.

To reproduce:

#!/usr/bin/env python
import markdown

text = """
# Footnotes ordering

It seems that footnotes appear in the order in which they are
defined[^definedsecond] rather than in the order of their 
occurrence[^definedfirst] in the text.

[^definedfirst]: blah
[^definedsecond]: blurb
"""

print(markdown.markdown(text, extensions=['footnotes']))

(Naively) expected behaviour: the footnotes are numbered 1 then 2 but they come out as 2 then 1.

I do realize that changing the behavior could break things, so perhaps documenting this would be the way to go?

Metadata

Assignees

No one assigned

    Labels

    docsRelated to the project documentation.extensionRelated to one or more of the included extensions.someday-maybeApproved low priority request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions