-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
unexpected trailing dash in auto heading ID for "# heading #" #6798
Comments
Ran into the same thing (trailing whitespace not trimmed in symmetric heading style) and my solution was to use the asymmetric heading style. Any reason not to file this as a bug in goldmark and close this one? |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
Please reopen:
Examples:
|
Applicable when autoHeadingIDType is either `github` or `github-ascii`. When autoHeadingIDType is `blackfriday`, the existing code removes trailing whitespace while iterating through the characters, using a boolean "futureDash" mechanism. Fixes #6798
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
)?The issue originates in the following commit:
Does this issue reproduce with the latest release?
Yes
Problematic document
Having the following markdown document (note trailing space after "Heading2"):
Correct auto heading IDs with blackFriday
If I turn on the "blackFriday" markdown parser with:
The generated heading IDs are both correct (no trailing dash):
Incorrect heading ID with goldmark
But If I use the default "goldmark" Markdown parser the generated ID
for the first heading contains unexpected trailing dash:
Input to Generate
I checked what enters
(*idFactory).Generate
(frommarkup/goldmark/autoid.go
) and for the first heading the input converted to string is "Heading1 " (has a trailing space) and for the second heading it is "Heading2".The text was updated successfully, but these errors were encountered: