mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Prevent double escaping of image alt-text in Goldmar typographer
Fixes #11045
This commit is contained in:
@@ -584,6 +584,29 @@ rightDoubleQuote = "»"
|
||||
c.Assert(got, qt.Contains, "<p>A «quote» and ‘another quote’ and a «quote with a ’nested’ quote» and a ‘quote with a «nested» quote’ and an ellipsis…</p>\n")
|
||||
}
|
||||
|
||||
// Issue #11045
|
||||
func TestTypographerImageAltText(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
|
||||
content := `
|
||||

|
||||
`
|
||||
|
||||
confStr := `
|
||||
[markup]
|
||||
[markup.goldmark]
|
||||
|
||||
`
|
||||
|
||||
cfg := config.FromTOMLConfigString(confStr)
|
||||
conf := testconfig.GetTestConfig(nil, cfg)
|
||||
|
||||
b := convert(c, conf, content)
|
||||
got := string(b.Bytes())
|
||||
|
||||
c.Assert(got, qt.Contains, "“They didn’t even say ‘hello’!” I exclaimed.")
|
||||
}
|
||||
|
||||
func unsafeConf() config.AllProvider {
|
||||
cfg := config.FromTOMLConfigString(`
|
||||
[markup]
|
||||
|
Reference in New Issue
Block a user