-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Regression? Heading anchors duplicated. Manual overrides ignored in v. 60.0 #6548
Comments
Additional information: This is related to Goldmark. If I revert to BlackFriday, the issue disappears, and custom anchors are rendered correctly. With custom anchors:
Without custom anchors:
|
What you are seeing is because of the new attributes support in headings in Goldmark. See https://github.com/yuin/goldmark/blob/master/README.md#headings. May be this should be a bug report on the Goldmark repo.. you do not have a space before the dot ( A temporary workaround might be to disable the attribute rendering in Goldmark. See https://gohugo.io/getting-started/configuration-markup/#goldmark. |
Thanks @kaushalmodi, There is indeed a change in syntax for how Goldmark render custom attributes compared to BlackFriday's way of rendering custom anchor tags on headings. This is not a bug and just a change in syntax required. Unfortunately from Goldmark: "This syntax possibly changes in the future. Headings" My workaround was to revert to BlackFriday until I can refactor the sites I keep. The bug is the repeated ID categories. They should be unique, or they are useless for most purposes. Should I be reporting this as a Goldmark bug? |
Yes, Blackfriday auto-uniquified the id's even if the user manually provided identical id's. It would be a very useful feature request on Goldmark repo. |
Thanks @kaushalmodi! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes
Issues
I maintain a Flora which has long lists of scientific names (Genus species) and long identification keys. I have been using manual override anchors in the format of {#anchor-text} to override the unpredictability of Hugo's automatic anchors
My headers are in the format of:
Previously (v. 58) the resulting HTML was:
The resulting HTML is now:
The overrides are being ignored and the ID anchors (which need to be unique) are being repeated.
The text was updated successfully, but these errors were encountered: