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!

1 Like

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

2 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 https://github.com/yuin/goldmark/pull/93

Yeah, I did in https://github.com/yuin/goldmark/issues/92. 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.

1 Like