1
0
Fork 0
mirror of https://git.sr.ht/~adnano/kiln synced 2024-06-03 15:46:05 +02:00

Add safeHTML, safeCSS, etc. functions

This commit is contained in:
Adnan Maolood 2021-05-10 00:50:19 -04:00
parent ebd42737c9
commit 7b634acde8

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