Files
hugo/content/functions/htmlEscape.md
T
Bjørn Erik Pedersen 4e0bca2b1e Remove the needsexamples construct
We need to rework the whole template func docs and, while a good idea, this does not fit into that.
2017-07-16 15:13:35 +02:00

799 B

title, linktitle, description, godocref, date, publishdate, lastmod, categories, menu, signature, workson, hugoversion, relatedfuncs, deprecated, aliases
title linktitle description godocref date publishdate lastmod categories menu 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
docs
parent
functions
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"