mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 18:52:09 -05:00
re-simplify SafeHTML function
This commit is contained in:
parent
1a26e35136
commit
619c16fd03
1 changed files with 3 additions and 1 deletions
|
@ -1181,6 +1181,8 @@ func SafeURL(text string) template.URL {
|
||||||
return template.URL(text)
|
return template.URL(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SafeHTML(a string) template.HTML { return template.HTML(a) }
|
||||||
|
|
||||||
func doArithmetic(a, b interface{}, op rune) (interface{}, error) {
|
func doArithmetic(a, b interface{}, op rune) (interface{}, error) {
|
||||||
av := reflect.ValueOf(a)
|
av := reflect.ValueOf(a)
|
||||||
bv := reflect.ValueOf(b)
|
bv := reflect.ValueOf(b)
|
||||||
|
@ -1380,7 +1382,7 @@ func init() {
|
||||||
"isSet": IsSet,
|
"isSet": IsSet,
|
||||||
"isset": IsSet,
|
"isset": IsSet,
|
||||||
"echoParam": ReturnWhenSet,
|
"echoParam": ReturnWhenSet,
|
||||||
"safeHTML": func(a string) template.HTML { return template.HTML(a) },
|
"safeHTML": SafeHTML,
|
||||||
"safeCSS": SafeCSS,
|
"safeCSS": SafeCSS,
|
||||||
"safeURL": SafeURL,
|
"safeURL": SafeURL,
|
||||||
"absURL": func(a string) template.HTML { return template.HTML(helpers.AbsURL(a)) },
|
"absURL": func(a string) template.HTML { return template.HTML(helpers.AbsURL(a)) },
|
||||||
|
|
Loading…
Reference in a new issue