From 619c16fd030ec2d3c2931c0cc0ca3d68eeb8b07b Mon Sep 17 00:00:00 2001 From: spf13 Date: Sun, 15 Nov 2015 11:10:35 -0500 Subject: [PATCH] re-simplify SafeHTML function --- tpl/template_funcs.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tpl/template_funcs.go b/tpl/template_funcs.go index 3963ed4d0..53666b925 100644 --- a/tpl/template_funcs.go +++ b/tpl/template_funcs.go @@ -1181,6 +1181,8 @@ func SafeURL(text string) template.URL { return template.URL(text) } +func SafeHTML(a string) template.HTML { return template.HTML(a) } + func doArithmetic(a, b interface{}, op rune) (interface{}, error) { av := reflect.ValueOf(a) bv := reflect.ValueOf(b) @@ -1380,7 +1382,7 @@ func init() { "isSet": IsSet, "isset": IsSet, "echoParam": ReturnWhenSet, - "safeHTML": func(a string) template.HTML { return template.HTML(a) }, + "safeHTML": SafeHTML, "safeCSS": SafeCSS, "safeURL": SafeURL, "absURL": func(a string) template.HTML { return template.HTML(helpers.AbsURL(a)) },