mdx-js / mdx

Markdown for the component era
https://mdxjs.com
MIT License
17.74k stars 1.14k forks source link

Feature request: footnotes #164

Closed lachlanjc closed 6 years ago

timneutkens commented 6 years ago

Please provide a full description when doing a feature request. This makes it easier for us to understand what you mean exactly.

lachlanjc commented 6 years ago

Some flavors of Markdown include support for footnotes/endnotes, and as someone using MDX for writing essays for school, it'd be great to have that built-in. See the "Footnotes" section here: https://help.ghost.org/article/4-markdown-guide

daneden commented 6 years ago

+1 I'm in the process of moving my blog off of Jekyll and onto Gatsby w/ MDX, and footnotes are a key part of many of my posts.

This paragraph has a footnote.[^1]

[^1]: Here's the footnote

Should render to something like:

<p>
  This paragraph has a footnote.<sup><a href="#fn1" id="fnref1">1</a></sup>
</p>

<!-- at the bottom of the document -->
<ol>
  <li id="fn1">Here's the footnote. <a href="#fnref1">↩</a></li>
</ol>
johno commented 6 years ago

Thanks for creating the issue @lachlanjc and providing your thoughts @daneden!

We've added support for footnotes in 0.12.0 via #173. Please let us know if you encounter any issues.

lachlanjc commented 6 years ago

Fantastic, thank you @johno!