-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature request] Support for linkable line numbers as supported by Chroma #25
Comments
If implemented, please remember that there may be two or more fenced code blocks in the same document. That means that the id of the element wrapping the line number must be unique to the document, not just the code block in which it occurs. Perhaps two attributes: a boolean to enable/disable, and a string to prepend to the id. |
Just to clarify, those would be equivalent to the I want to make sure that this extension doesn't auto-generate an anchor prefix if the user provides one. |
Yes, but Hugo is just one of several projects that leverage yuin/goldmark and yuin/goldmark-highlighting. Implementation details need to be somewhat agnostic with respect to downstream projects. |
Closing this issue here because the issue was apparently fixed in Hugo itself in gohugoio/hugo@08fdca9 . |
Hello,
Can you please enable the support of
LinkableLineNumbers()
as supported by Chroma?https://github.com/alecthomas/chroma#the-html-formatter
Hugo supported enabling the generation of linkable line numbers by passing the
anchorlinenos=true
attribute to the Hugohighlight
shortcode. That shortcode internally uses the same Chroma library to do the code syntax highlighting.Right now, the
highlight
shortcode inherits thisanchorlinenos=true
feature from Chroma. But if I try to use code fences with that attribute, I do not get anchorized line numbers because this library doesn't support that.Thanks!
References
anchorlinenos
andlineanchors
attributes do not work when using with code fences gohugoio/hugo#9385The text was updated successfully, but these errors were encountered: