浏览代码

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

Laurence Jones 1 年之前
父节点
当前提交
aff80a2863
共有 1 个文件被更改,包括 3 次插入1 次删除
  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 {