-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Hugo 0.141.0 strips apostrophes from image alt strings #13286
Comments
My notes below assume that:
In an image render hook with v0.138.0:
Then Goldmark deprecated
For this example the change above didn't affect us because the image render hook was calling Then I made this change in v0.141.0 after @Arty2 pointed out the following in the images section of the CommonMark specification:
But in retrospect I guess I really don't know what "plain string content" means... there's a bit of wiggle room there. Testing the image link above on the Goldmark playground with the typographer extension enabled yields this:
So, unless someone has a differing opinion, I think we should revert 8af0474. @Arty2 You kind of got this ball rolling. Any comments? |
I guess introduced in 8af0474. Failing test: // Issue 13286
func TestImageAltApostrophes(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
[languages]
[languages.en]
languageCode = "en"
-- content/p1.md --
---
title: "p1"
---
## Image
![A's and B's](some-image.png)
-- layouts/_default/single.html --
{{ .Content }}
`
b := hugolib.Test(t, files)
b.AssertFileContentExact("public/p1/index.html",
"A’s and B’s",
)
} This is an odd one. |
Attached to this issue is a minimalist Hugo project, hugo-141-alt-issue.zip, with the following markdown in the main
index.md
file:Here's how Hugo 0.140.2 and 0.141.0 render HTML for the markdown image syntax above:
Note that Hugo 0.141.0 doesn't generate the
’
in thealt
text.Now comment out the
languages
entry from the project'shugo.yaml
config, and Hugo 0.141.0 will generate the’
once again:I'm working under macOS.
/cc @svrnm
The text was updated successfully, but these errors were encountered: