Say we have in our head.html file following code:
<meta property="og:description" content="{{ if .IsHome }}{{ site.Params.description | safeHTML }}{{ else }}{{ .Description | safeHTML }}{{ end }}">
and say site’s config.yaml file has:
params:
description: It is ++, but also < and >
then output is not what one would expect.
I expected:
<meta property="og:description" content="It is ++, but also < and >">
but it was:
<meta property="og:description" content="It is ++, but also < and >">
I also tried htmlUnescape
.
Thoughts?
ju52
2
What you want is invalid HTML!
pls read
1 Like