mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
tpl/transform: Make Plainify and ToMath return template.HTML
None of these are useful as plain strings in the templates, which forces the users to do `transform.Plainify "foo" | safeHTML`. If people have trust issues with the output of these functions, they need to just stop using them. Closes #8732
This commit is contained in:
@@ -141,8 +141,7 @@ func TestToMath(t *testing.T) {
|
||||
-- hugo.toml --
|
||||
disableKinds = ['page','rss','section','sitemap','taxonomy','term']
|
||||
-- layouts/index.html --
|
||||
{{ $result := transform.ToMath "c = \\pm\\sqrt{a^2 + b^2}" }}
|
||||
{{ printf "%v" $result | safeHTML }}
|
||||
{{ transform.ToMath "c = \\pm\\sqrt{a^2 + b^2}" }}
|
||||
`
|
||||
b := hugolib.Test(t, files)
|
||||
|
||||
|
Reference in New Issue
Block a user