hugoDocs/content/functions/htmlEscape.md
2017-03-27 16:32:31 -05:00

764 B

title linktitle description godocref date publishdate lastmod categories tags ns signature workson hugoversion relatedfuncs deprecated aliases
htmlEscape Returns the given string with the critical reserved HTML codes escaped. 2017-02-01 2017-02-01 2017-02-01
functions
strings
html
htmlEscape INPUT
htmlUnescape
false

htmlEscape returns the given string with the critical reserved HTML codes escaped, such that & becomes &amp; and so on. It escapes only: <, >, &, ' and ".

Bear in mind that, unless content is passed to safeHTML, output strings are escaped usually by the processor anyway.

{{ htmlEscape "Hugo & Caddy > Wordpress & Apache" }} → "Hugo &amp; Caddy &gt; Wordpress &amp; Apache"