Browse Source

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

Laurence Jones 1 year ago
parent
commit
aff80a2863
1 changed files with 3 additions and 1 deletions
  1. 3 1
      pkg/csplugin/helpers.go

+ 3 - 1
pkg/csplugin/helpers.go

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