You want safeHTMLAttr
, which you need to apply to the key/val pair, not just the val.
{{ $u := "https://example.org?a=b+c" }}
<a {{ printf "href=%s" $u | safeHTMLAttr }}>foo</a>
You want safeHTMLAttr
, which you need to apply to the key/val pair, not just the val.
{{ $u := "https://example.org?a=b+c" }}
<a {{ printf "href=%s" $u | safeHTMLAttr }}>foo</a>