diff --git a/hugolib/content_render_hooks_test.go b/hugolib/content_render_hooks_test.go index 7f2c3503216..3e599f946b6 100644 --- a/hugolib/content_render_hooks_test.go +++ b/hugolib/content_render_hooks_test.go @@ -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: text-"<>&", - "img src=\"/destination-%22%3C%3E\" alt=\"alt-"<>&\" title=\"title-"<>&\">", + "img src=\"/destination-%22%3C%3E\" alt=\"alt-"<>&\" title=\"title-"<>&\">", "><script>", ) } else { diff --git a/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html b/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html index 5c0f4383597..d5040f6df37 100644 --- a/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html +++ b/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html @@ -12,7 +12,7 @@ {{- end -}} {{- end -}} {{- end -}} -{{ .Text }}`, `alt1`, - `alt2-&<>’`, + `alt2-&<>'`, `alt3`, `alt4`, ) @@ -185,7 +187,7 @@ iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAA b.AssertFileContent("public/p1/index.html", ``, `alt1`, - `alt2-&<>’`, + `alt2-&<>'`, `alt3`, `alt4`, )