Fix render hook's PlainText with typographer extension enabled

Fixes #13286
Fixes #13292
This commit is contained in:
Bjørn Erik Pedersen
2025-01-21 10:57:06 +01:00
parent 9885e7020d
commit 6aa72acaf9
2 changed files with 39 additions and 1 deletions

View File

@@ -527,6 +527,39 @@ a <!-- b --> c
)
}
// Issue 13286
func TestImageAltApostrophesWithTypographer(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
[markup.goldmark.extensions.typographer]
disable = false
[markup.goldmark.renderHooks.image]
enableDefault = true
-- content/p1.md --
---
title: "p1"
---
## Image
![A's is > than B's](some-image.png)
-- layouts/_default/single.html --
{{ .Content }}
`
b := hugolib.Test(t, files)
b.AssertFileContentExact("public/p1/index.html",
// Note that this markup is slightly different than the one produced by the default Goldmark renderer,
// see issue 13292.
"alt=\"As is &gt; than Bs\">",
)
}
// Issue #7332
// Issue #11587
func TestGoldmarkEmojiExtension(t *testing.T) {