rewrite safeHTML function
authorspf13 <steve.francia@gmail.com>
Thu, 12 Nov 2015 15:53:21 +0000 (10:53 -0500)
committerspf13 <steve.francia@gmail.com>
Sun, 15 Nov 2015 16:05:16 +0000 (11:05 -0500)
tpl/template_funcs.go

index f704f0a4fb94acfe470ae2591cd7393e54da6f12..3963ed4d0139f471aef4a156237179fb05ddb24b 100644 (file)
@@ -1167,10 +1167,6 @@ func DateFormat(layout string, v interface{}) (string, error) {
        return t.Format(layout), nil
 }
 
-func SafeHTML(text string) template.HTML {
-       return template.HTML(text)
-}
-
 // "safeHTMLAttr" is currently disabled, pending further discussion
 // on its use case.  2015-01-19
 func SafeHTMLAttr(text string) template.HTMLAttr {
@@ -1384,7 +1380,7 @@ func init() {
                "isSet":        IsSet,
                "isset":        IsSet,
                "echoParam":    ReturnWhenSet,
-               "safeHTML":     SafeHTML,
+               "safeHTML":     func(a string) template.HTML { return template.HTML(a) },
                "safeCSS":      SafeCSS,
                "safeURL":      SafeURL,
                "absURL":       func(a string) template.HTML { return template.HTML(helpers.AbsURL(a)) },