↳
In-reply-to
»
hi guys. I am trying to solve the following problem in Go: I have a go template that just uses {{.Body}} or {{printed "%s" .Body}} for output.
on the go side I am using templates.ExecuteTemplate(w,"view.html",data) as input.
the data.Body is a []byte which contains valid HTML.
The problem is, in the browser, or the templates.Execute only send escaped text to the browser. But it should not so I can create html on the server side
⤋ Read More
@carsten@yarn.zn80.net You want to use template.HTML
in this case, to mark the “HTML” as safe to render as-is without escaping it. This is by design and for security. If you know your input is safe, then use this instead of a string