providers/http: Add unsafe function to directly embed HTML

This commit is contained in:
Sasha Koshka 2024-12-27 14:39:26 -05:00
parent 5733d00735
commit d645f44fb7

View File

@ -28,6 +28,7 @@ func (this *Provider) FuncMap () template.FuncMap {
"redirect": funcRedirect,
"queryEscape": url.QueryEscape,
"queryUnescape": url.QueryUnescape,
"unsafe": funcUnsafe,
}
}
@ -59,3 +60,7 @@ func funcParseForm (req *http.Request) url.Values {
if err != nil { return nil }
return req.Form
}
func funcUnsafe(text string) template.HTML {
return template.HTML(text)
}