mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-11-27 20:14:20 +00:00
Add safeHTML, safeCSS, etc. functions
This commit is contained in:
parent
d7567ca69f
commit
e976aa1be7
|
@ -70,9 +70,11 @@ func LoadConfig(path string) (*Config, error) {
|
||||||
}
|
}
|
||||||
return b.String(), nil
|
return b.String(), nil
|
||||||
},
|
},
|
||||||
"html": func(s string) template.HTML {
|
"safeHTML": func(s string) template.HTML { return template.HTML(s) },
|
||||||
return template.HTML(s)
|
"safeHTMLAttr": func(s string) template.HTMLAttr { return template.HTMLAttr(s) },
|
||||||
},
|
"safeCSS": func(s string) template.CSS { return template.CSS(s) },
|
||||||
|
"safeJS": func(s string) template.JS { return template.JS(s) },
|
||||||
|
"safeURL": func(s string) template.URL { return template.URL(s) },
|
||||||
})
|
})
|
||||||
|
|
||||||
return c, nil
|
return c, nil
|
||||||
|
|
Loading…
Reference in a new issue