Back to Hugo

transform.HTMLEscape

docs/content/en/functions/transform/HTMLEscape.md

0.161.1403 B
Original Source

The transform.HTMLEscape function escapes five special characters by replacing them with HTML entities:

  • &&
  • <&lt;
  • >&gt;
  • '&#39;
  • "&#34;

For example:

go-html-template
{{ htmlEscape "Lilo & Stitch" }} → Lilo &amp; Stitch
{{ htmlEscape "7 > 6" }} → 7 &gt; 6