diff --git a/tpl/tplimpl/embedded/templates/schema.html b/tpl/tplimpl/embedded/templates/schema.html index c4e89abd6e9..2b3c5425aeb 100644 --- a/tpl/tplimpl/embedded/templates/schema.html +++ b/tpl/tplimpl/embedded/templates/schema.html @@ -1,8 +1,8 @@ -{{- with or .Title site.Title }} +{{- with or .Title site.Title | plainify }} {{- end }} -{{- with or .Description .Summary site.Params.Description }} +{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape | chomp }} {{- end }} diff --git a/tpl/tplimpl/tplimpl_integration_test.go b/tpl/tplimpl/tplimpl_integration_test.go index f9d25eb49f3..b30965be938 100644 --- a/tpl/tplimpl/tplimpl_integration_test.go +++ b/tpl/tplimpl/tplimpl_integration_test.go @@ -411,3 +411,85 @@ series: [series-1] ``, ) } + +// Issue 12432 +func TestSchema(t *testing.T) { + t.Parallel() + + files := ` +-- hugo.toml -- +capitalizeListTitles = false +disableKinds = ['rss','sitemap'] +[markup.goldmark.renderer] +unsafe = true +[params] +description = "m n and **o** can't." +[taxonomies] +tag = 'tags' +-- layouts/_default/list.html -- +{{ template "_internal/schema.html" . }} +-- layouts/_default/single.html -- +{{ template "_internal/schema.html" . }} +-- content/s1/p1.md -- +--- +title: p1 +date: 2024-04-24T08:00:00-07:00 +lastmod: 2024-04-24T11:00:00-07:00 +images: [a.jpg,b.jpg] +tags: [t1,t2] +--- +a b and **c** can't. +-- content/s1/p2.md -- +--- +title: p2 +--- +d e and **f** can't. + +-- content/s1/p3.md -- +--- +title: p3 +summary: g h and **i** can't. +--- +-- content/s1/p4.md -- +--- +title: p4 +description: j k and **l** can't. +--- +-- content/s1/p5.md -- +--- +title: p5 +--- +` + + b := hugolib.Test(t, files) + + b.AssertFileContent("public/s1/p1/index.html", ` + + + + + + + + + `, + ) + + b.AssertFileContent("public/s1/p2/index.html", + ``, + ) + + b.AssertFileContent("public/s1/p3/index.html", + ``, + ) + + // The markdown is intentionally not rendered to HTML. + b.AssertFileContent("public/s1/p4/index.html", + ``, + ) + + // The markdown is intentionally not rendered to HTML. + b.AssertFileContent("public/s1/p5/index.html", + ``, + ) +}