Does Goldmark Support [^namedfootnotes]?

I’m experimenting with switching from Blackfriday to Goldmark, and in most respects it seems better. One place it does not, however, is with named footnotes. With Blackfriday, I can use the named footnote syntax like so:

Blah blah blah[^butalso]

[^butalso]: Something I want to mention elsewhere.

Goldmark does properly parse and output these as footnotes, except that instead of using the name (<a href href="#fn:butalso"), it uses numbers (<a href="#fnref:1"). This is fine for single pages, but messes things up on list pages where multiple stories have footnotes, because it resets the count for each story. Anyone know of a Goldmark config to get it to use the names, or might it need to be a feature request for Goldmark?

Thanks!

2 Likes

Goldmark cannot be configured in this way.

It has been requested before, and is unlikely to happen. See:

https://github.com/yuin/goldmark/issues/92
https://github.com/yuin/goldmark/pull/90
https://github.com/yuin/goldmark/pull/93

3 Likes

Thanks. So I guess the next question is, has someone made a Goldmark extension for this, and if so, how does one use it with Hugo?

Unknown. You might reach out to the author of https://github.com/yuin/goldmark/pull/93.

Fork Hugo, modify source code, build, and test. Assistance with this activity is not within the scope of this support forum.

Unknown. You might reach out to the author of Named footnotes by tv42 · Pull Request #93 · yuin/goldmark · GitHub

Yeah, I did in Use non-numeric footnote anchor in id and href · Issue #92 · yuin/goldmark · GitHub. sjml has replied.

Fork Hugo, modify source code, build, and test. Assistance with this activity is not within the scope of this support forum.

Ah, not dynamic, then. Pity. Guess I just have to accept broken footnotes on list pages or use blackfriday. :frowning:

I guess another approach would be to add support for footnote render templates.

2 Likes