mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
cdd6a124c2
commit
c21e2b3b4d
2 changed files with 1 additions and 6 deletions
|
@ -546,7 +546,6 @@ rendering the whole string as plain-text like this:
|
|||
<p>© 2015 Jane Doe. <a href="http://creativecommons.org/licenses/by/4.0/">Some rights reserved</a>.</p>
|
||||
</blockquote>
|
||||
|
||||
<!--
|
||||
### safeHTMLAttr
|
||||
Declares the provided string as a "safe" HTML attribute
|
||||
from a trusted source, for example, ` dir="ltr"`,
|
||||
|
@ -560,8 +559,6 @@ Example: Given a site-wide `config.toml` that contains this menu entry:
|
|||
|
||||
* `<a href="{{ .URL }}">` ⇒ `<a href="#ZgotmplZ">` (Bad!)
|
||||
* `<a {{ printf "href=%q" .URL | safeHTMLAttr }}>` ⇒ `<a href="irc://irc.freenode.net/#golang">` (Good!)
|
||||
-->
|
||||
|
||||
|
||||
### safeCSS
|
||||
Declares the provided string as a known "safe" CSS string
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue