Hi

I have an HTML template where I'd like to provide <link> tags externally. 
I'd like to
leverage html/template's escaping for href. Therefore, it seemed easiest to 
just
create a struct with fields for rel, href, title and type.

Trying to just use string types means I get everything escaped. 
Surprisingly, this
means that + gets escaped into &#43;.

Since I've never before seen "application/atom&#43;xml", I'm not convinced 
that
everything I'd like interop with will correctly turn the HTML entity back 
into a +.

As the types don't actually vary that much currently, I am fine documenting 
in code that
either they should be constants, or that they should be separately 
sanitized. So I tried
using template.HTMLAttr and, when that failed, template.HTML to prevent 
escaping of the
plus.

This still gets escaped:

https://play.golang.org/p/eZxQrHy1vCE

Is this a bug? How do I avoid html/template escaping this, while still 
escaping
href?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to