htmlEscape.md (582B)
1 --- 2 title: htmlEscape 3 linktitle: 4 description: Returns the given string with the reserved HTML codes escaped. 5 date: 2017-02-01 6 publishdate: 2017-02-01 7 lastmod: 2017-02-01 8 categories: [functions] 9 menu: 10 docs: 11 parent: "functions" 12 keywords: [strings, html] 13 signature: ["htmlEscape INPUT"] 14 workson: [] 15 hugoversion: 16 relatedfuncs: [htmlUnescape] 17 deprecated: false 18 aliases: [] 19 --- 20 21 In the result `&` becomes `&` and so on. It escapes only: `<`, `>`, `&`, `'` and `"`. 22 23 ``` 24 {{ htmlEscape "Hugo & Caddy > WordPress & Apache" }} → "Hugo & Caddy > WordPress & Apache" 25 ```