mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-10-30 01:13:08 +00:00
Add safeHTML, safeCSS, etc. functions
This commit is contained in:
parent
ebd42737c9
commit
7b634acde8
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue