You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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.
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.
Activity
ehuss commentedon May 25, 2021
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.
chriskrycho commentedon Jul 27, 2021
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.
Add a separate mode to parse footnotes the same way GitHub does
Add a separate mode to parse footnotes the same way GitHub does
Add a separate mode to parse footnotes the same way GitHub does
Add a separate mode to parse footnotes the same way GitHub does
Add a separate mode to parse footnotes the same way GitHub does
Add a separate mode to parse footnotes the same way GitHub does
Add a separate mode to parse footnotes the same way GitHub does