Add html escape function so it can be invoked from template (#2451)
This commit is contained in:
parent
22146eb3e4
commit
aff80a2863
1 changed files with 3 additions and 1 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue