markedjs / marked

A markdown parser and compiler. Built for speed.
https://marked.js.org
Other
32.32k stars 3.36k forks source link

Feature request: footnotes #3309

Closed grepsuzette closed 3 weeks ago

grepsuzette commented 1 month ago

Marked version: marked v12.0.2

Describe the bug "footnotes" seem unsupported.

To Reproduce Having bottom-notes such[^1] as[^2] this[^3] kind[^4] will have them on a continuous line, missing some <br /> probably (edit: actually not a bug, it's currently unsupported!).

[^1]: in github [^2]: those are rendered one [^3]: per line, [^4]: but not with markedjs (it's shown on one line).

Demo is here

Commonmark does not have them either. It may just be a github thing. Would you have it if PR?

UziTech commented 1 month ago

Unfortunately GitHub still doesn't have footnotes in their spec which makes it very difficult to know how to handle edge cases.

There is already an extension that works to add them to marked: https://github.com/bent10/marked-extensions/tree/main/packages/footnote