shithub: hugo

Download patch

ref: 619c16fd030ec2d3c2931c0cc0ca3d68eeb8b07b
parent: 1a26e351368c1967efe7ae51303717977bf86c67
author: spf13 <[email protected]>
date: Sun Nov 15 06:10:35 EST 2015

re-simplify SafeHTML function

--- a/tpl/template_funcs.go
+++ b/tpl/template_funcs.go
@@ -1181,6 +1181,8 @@
 	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 @@
 		"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)) },