Hi Guilio,

the playground example is using `text/template`. If you use `html/template` instead it'll also do the replacement.

The behaviour is part of `html/template`'s feature set, and as far as I can remember (since at least 2015) has been present under the umbrella of context aware escaping of special characters.

On 20.03.20 11:40, liuggio wrote:
Hello everybody,
we are issuing on our website a problem with templating,

variable is: "+"
is converted to:  "+"
and inside the *<script* is converted to: "\x2b"
the output of that function is:
                    "plain": "&#43;"
                    <script type="application/ld+json" >
                      { "plain inside ld+json": "\x2b"  }

i created the running example https://play.golang.org/p/sGP2Y2KCXLg
but in the play.golang.org <http://play.golang.org> website the bug is not visible (maybe 'cause) it uses the v1.13

on my local (mac) and also on golang-1.14-alpine the problem can be easily reproduced.

this is breaking all the seo on our website,
and is this is breaking compatibility with the past version.
am I missing something?

thanks a lot.
Giulio

--
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 <mailto:golang-nuts+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CALphBct9bULDxwUebSSzhxUi%3D8BUyaDqcMchPPsBbj9CL-nWrA%40mail.gmail.com <https://groups.google.com/d/msgid/golang-nuts/CALphBct9bULDxwUebSSzhxUi%3D8BUyaDqcMchPPsBbj9CL-nWrA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
--
  Gregor Best
  b...@pferdewetten.de

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/758159c3-a977-c598-8d41-b8ec9c0eca0d%40pferdewetten.de.

Reply via email to