Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tpl
diff options
context:
space:
mode:
authormarco <marco@webguerilla.net>2016-06-22 14:21:04 +0300
committerAnthony Fok <foka@debian.org>2016-06-27 18:18:14 +0300
commitc21e2b3b4d759bc84ba080bc35059bb51eb34144 (patch)
tree96b3a4ebc81ff6e867f6df24be22772ff741fc35 /tpl
parentcdd6a124c2763da57108adebe079baab5958076a (diff)
tpl: Enable safeHTMLAttr
See #2234 and #347
Diffstat (limited to 'tpl')
-rw-r--r--tpl/template_funcs.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/tpl/template_funcs.go b/tpl/template_funcs.go
index 80ecdfe0c..db785cbc0 100644
--- a/tpl/template_funcs.go
+++ b/tpl/template_funcs.go
@@ -1576,9 +1576,6 @@ func readDirFromWorkingDir(i interface{}) ([]os.FileInfo, error) {
}
// safeHTMLAttr returns a given string as html/template HTMLAttr content.
-//
-// safeHTMLAttr is currently disabled, pending further discussion
-// on its use case. 2015-01-19
func safeHTMLAttr(a interface{}) template.HTMLAttr {
return template.HTMLAttr(cast.ToString(a))
}
@@ -1806,6 +1803,7 @@ func init() {
"replaceRE": replaceRE,
"safeCSS": safeCSS,
"safeHTML": safeHTML,
+ "safeHTMLAttr": safeHTMLAttr,
"safeJS": safeJS,
"safeURL": safeURL,
"sanitizeURL": helpers.SanitizeURL,