markdown-it-footnote icon indicating copy to clipboard operation
markdown-it-footnote copied to clipboard

For footnotes linked via an id, use id when generating the hash

Open LeaVerou opened this issue 1 year ago • 8 comments

Thanks for making this wonderful plugin!

I’ve been using this for a while, and this is the only place where I keep feeling there is room for improvement. The syntax allows for specifying footnotes either with an id, or with a number:

Here is a footnote reference,[^1] and another.[^longnote]

[^1]: Here is the footnote.

[^longnote]: Here's one with multiple blocks.

However, when markdown is generated, links to footnotes still look like #fn1. This has the usual ordered reference problem: if more footnotes are added above a given footnote, its link changes. If it didn't work that way, using ids could have been a nice way to ensure that Cool URIs don’t change. I understand this may not always be desirable, but it could be a sensible default with an option to override it if the current behavior is desired.

LeaVerou avatar Jan 10 '24 14:01 LeaVerou