Add safeHTML, safeCSS, etc. functions

This commit is contained in:
adnano 2021-05-10 00:50:19 -04:00
parent d7567ca69f
commit e976aa1be7

View file

@ -70,9 +70,11 @@ func LoadConfig(path string) (*Config, error) {
}
return b.String(), nil
},
"html": func(s string) template.HTML {
return template.HTML(s)
},
"safeHTML": func(s string) template.HTML { 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