DESIGN SYSTEM

  • Principles
  • Components
  • Documentation
FUNCTIONS

htmlEscape

Returns the given string with the reserved HTML codes escaped.

Syntax

htmlEscape INPUT

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

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

See Also

  • errorf
  • float
  • strings.TrimLeft
  • println
  • dateFormat
  • Foundation styles (FS)
  • Content text (CT)
  • Buttons and links (BL)
  • Form elements (FE)
  • Icons (IC)
  • Miscellaneous (MS)
“htmlEscape” was last updated: January 29, 2019: A little bit of naming reorganisation (8fb631a0)
Improve this page
By the Hugo Authors
Hugo Logo
  • File an Issue
  • Get Help
  • Discuss Source Code
  • @GoHugoIO
  • @spf13
  • @bepsays

 
  Hugo Sponsors
Logo for Forestry.io
Logo for Linode
Logo for eSolia
 

The Hugo logos are copyright © Steve Francia 2013–2019.

The Hugo Gopher is based on an original work by Renée French.

  • Principles
  • Components
  • Documentation
  • Foundation styles (FS)
  • Content text (CT)
  • Buttons and links (BL)
  • Form elements (FE)
  • Icons (IC)
  • Miscellaneous (MS)