Add html escape function so it can be invoked from template (#2451)

This commit is contained in:
Laurence Jones 2023-09-04 09:49:39 +01:00 committed by GitHub
parent 22146eb3e4
commit aff80a2863
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
package csplugin package csplugin
import ( import (
"html"
"os" "os"
"text/template" "text/template"
@ -28,7 +29,8 @@ var helpers = template.FuncMap{
} }
return ret return ret
}, },
"Hostname": os.Hostname, "Hostname": os.Hostname,
"HTMLEscape": html.EscapeString,
} }
func funcMap() template.FuncMap { func funcMap() template.FuncMap {