How to unescape plus sign in URL? (Re Cloudflare Fonts)

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>
2 Likes