htmlEscape

将以下英文翻译为中文:

htmlEscape

https://gohugo.io/functions/htmlescape/

Returns the given string with the reserved HTML codes escaped.

语法

htmlEscape INPUT

In the result & becomes & and so on. It escapes only: <, >, &, ' and ".

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

另请参阅