tpl/tplimpl: Use plain text for image render hook alt attribute

Co-authored-by: Heracles <email@heracl.es>
This commit is contained in:
Joe Mooring
2025-01-09 23:36:10 -08:00
committed by Bjørn Erik Pedersen
parent dde9d9d544
commit 8af04745fb
3 changed files with 10 additions and 6 deletions

View File

@@ -246,9 +246,10 @@ iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAA
func TestRenderHooksDefaultEscape(t *testing.T) {
files := `
-- hugo.toml --
[markup.goldmark.renderHooks]
[markup.goldmark.extensions.typographer]
disable = true
[markup.goldmark.renderHooks.image]
enableDefault = ENABLE
enableDefault = ENABLE
[markup.goldmark.renderHooks.link]
enableDefault = ENABLE
[markup.goldmark.parser]
@@ -256,6 +257,7 @@ wrapStandAloneImageWithinParagraph = false
[markup.goldmark.parser.attribute]
block = true
title = true
-- content/_index.md --
---
title: "Home"
@@ -279,7 +281,7 @@ Image: ![alt-"<>&](/destination-"<> 'title-"<>&')
if enabled {
b.AssertFileContent("public/index.html",
"Link: <a href=\"/destination-%22%3C%3E\" title=\"title-&#34;&lt;&gt;&amp;\">text-&quot;&lt;&gt;&amp;</a>",
"img src=\"/destination-%22%3C%3E\" alt=\"alt-&quot;&lt;&gt;&amp;\" title=\"title-&#34;&lt;&gt;&amp;\">",
"img src=\"/destination-%22%3C%3E\" alt=\"alt-&#34;&lt;&gt;&amp;\" title=\"title-&#34;&lt;&gt;&amp;\">",
"&gt;&lt;script&gt;",
)
} else {