Skip to content

Document footnote syntax #530

Closed
Closed

Description

@ISSOtm

It's not in the CommonMark spec, and unlike the GitHub syntax extensions, the README does not link to anything. I've only figured out the syntax by finding an example; where can the README point to?

Activity

  1. ehuss commented on May 25, 2021

    @ehuss
    Contributor

    I don't think there are any specs to point to. I believe this is inherited from hoedown, which I think maybe was using the syntax from php-markdown. Footnotes have become common across many markdown parsers, including GitHub's own cmark fork which confusingly GitHub does not enable their own footnote extension, but GitLab, which uses the same library, does enable it (tests here). It is also mentioned in the commonmark extensions. It is also documented in many places like the Markdown Guide.

    Better documentation would be great, but in this instance there isn't anything concrete to point to. I think this project is free to grab the documentation I wrote here if it wants to use something more vague. Writing a spec would be valuable, but is somewhat tedious. I'm not aware of any project that has done that to the extent GFM did.

  2. chriskrycho commented on Jul 27, 2021

    @chriskrycho

    It's also worth note that this implementation diverges substantially from most others in how it handles footnotes by default (#20, #142, #434, #464, #514, etc.). In terms of an intuitive description of the behavior, footnotes should behave basically the same way that list items or blockquotes do: the presence of [^<definition name>]: starts a new block-level item, and everything within it follows block-level item rules identically to those other block-level elements. (The same would go for definition lists and a number of other extensions if this library were to support those.)

    Related to the question of documenting the footnote syntax (and its current divergence from other implementations) is the question of whether pulldown-cmark should standardize on the rules used in other implementations, which would require a breaking change or maintaining both options in perpetuity. There’s quite a lot of code out there which relies on the existing implementation—basically every user of Zola, for example—which makes a breaking change not especially appealing; but maintaining separate parse-and-render paths is also pretty unappealing.

  3. added 7 commits that reference this issue on Jun 1, 2023
    3ce7fd7
    093f124
    e3dc6cf
    cffdb96
    c1ad321
    3a93292
    3d184fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions