Open bowman2001 opened 1 year ago
I agree that this would be nice to have, but it's non-trivial to implement. The implementation we have for code blocks is expensive/slow. The main challenge is the shortcodes with {{<
delimiters; the position you get when parsing the Markdown (Goldmark, assuming that info is there) does not take the shortcodes into account. And if you think about the new {https://github.com/gohugoio/hugo/pull/11320 ... there's lots to think about, as Position may well point to a different Markdown file.
I’ve hoped this would be relatively easy. So it can wait, it’s certainly not a priority.
The codeblock render hook context includes the
.Position
of the current codeblock in a local Markdown file.It would be nice to have this information also for heading and image render hooks. This would allow to include links to the source in local server mode.