Goldmark includes a system for extensions, but the author is (understandably!) conservative about what is included in the main repository. This came up when I submitted a PR to enable labeled footnotes ([^name] instead of just [^1]), and only then realized that the goal of Goldmark’s footnote support was to mirror PHP Markdown Extra’s footnote feature, not BlackFriday’s.
Such a feature would be easy to craft as an extension, but it would have to be enabled at compile time and built into the Hugo executable, I believe. (If that is not the case, please let me know!)
I totally understand if we wouldn’t want to introduce another external dependency to Hugo just for the sake of this relatively minor point of feature parity with a deprecated library, but is there any interest in a feature like this? I’d be happy to create the Goldmark extension, but the author was clear that it wasn’t something that would be accepted in the main repository.
Would we perhaps be open to having a set of Goldmark extensions that are part of Hugo? It might be overkill or invite too much bikeshedding, but it feels like a useful question to ask going forward if Goldmark is going to be the default renderer; eventually I imagine there might be other Markdown rendering features that would benefit Hugo.
(Background: I rely on the unique anchor tags generated by labeling footnotes this way (when assembling several pages into a larger one) so for now I’m sticking with BlackFriday as my Markdown renderer, but I’d like to be ready for a future where that’s no longer an option.)
For the record, I can’t answer your question, I was wondering about Goldmark &updated this thread because I’m trying to assess how to tackle my own footnote “issue”/wish.
In conjunction with Hugo they would allow static pages without any JS dependencies to support mermaid and katex code blocks in Markdown content authoring (rendered to SVG by Goldmark/Hugo).
I suspect such features would be of interest for a lot of Hugo users and theme developers.
Any chance the officially acknowledged third-party goldmark extensions could be integrated in Hugo’s extended version and the markdown code block parsing of the respective format additions be made opt-in via global config? And perhaps, possibly existing codeblock render hooks could even have precedence over goldmark-rendering for maximum flexibility?
I also wonder whether Hugo’s GoAT support wouldn’t be better served as a Goldmark extension.
@jmooring The fact that goldmark-mermaid calls out to the MermaidJS CLI isn’t an inherent blocker for inclusion in Hugo, right? It just means users would have to npm i @mermaid-js/mermaid-cli to be able to use the feature, no?