# I am the Watcher. I am your guide through this vast new twtiverse.
#
# Usage:
# https://watcher.sour.is/api/plain/users View list of users and latest twt date.
# https://watcher.sour.is/api/plain/twt View all twts.
# https://watcher.sour.is/api/plain/mentions?uri=:uri View all mentions for uri.
# https://watcher.sour.is/api/plain/conv/:hash View all twts for a conversation subject.
#
# Options:
# uri Filter to show a specific users twts.
# offset Start index for quey.
# limit Count of items to return (going back in time).
#
# twt range = 1 6
# self = https://watcher.sour.is/conv/ioqbpxq
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
any ideas on how to solve this?
@carsten 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
@carsten 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
@prologic mmh OK. so inside the struct instead of []byte I use template.HTML let me try