yshavit / mdq

like jq but for Markdown: find specific elements in a md doc
Apache License 2.0
5 stars 0 forks source link

renumber footnotes #89

Closed yshavit closed 1 month ago

yshavit commented 3 months ago

If I have a footnote [^a], it gets rendered by GFM as [1]not [a].

I should accordingly canonicalize the footnotes on output, so that they look like the text they'll eventually become.

This should be an option, defaulting to on.

yshavit commented 1 month ago

Testing the interaction of footnotes and link references:

[hello][3], world[^3] [^a] [^1] [^shortcut] [^collapsed][].

[3]: https://example.com
[^a]: a footnote
[^3]: this is my footnote text.
[^1]: my second footnote text.
[^shortcut]: my shortcut footnote text.
[^collapsed]: my collapsed footnote text

results in:

hello, world[^3] [^a] [^1] [^shortcut] [^collapsed][].

[^a]: a footnote [^3]: this is my footnote text. [^1]: my second footnote text. [^shortcut]: my shortcut footnote text. [^collapsed]: my collapsed footnote text

So it looks like: