providers/http: Add unsafe function to directly embed HTML
This commit is contained in:
parent
5733d00735
commit
d645f44fb7
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user