diff options
Diffstat (limited to 'docs/content/en/functions/transform/HTMLEscape.md')
-rw-r--r-- | docs/content/en/functions/transform/HTMLEscape.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/content/en/functions/transform/HTMLEscape.md b/docs/content/en/functions/transform/HTMLEscape.md new file mode 100644 index 000000000..62249367b --- /dev/null +++ b/docs/content/en/functions/transform/HTMLEscape.md @@ -0,0 +1,24 @@ +--- +title: transform.HTMLEscape +linkTitle: htmlEscape +description: Returns the given string with the reserved HTML codes escaped. +categories: [functions] +keywords: [] +menu: + docs: + parent: functions +function: + aliases: [htmlEscape] + returnType: string + signatures: [transform.HTMLEscape INPUT] +relatedFunctions: + - transform.HTMLEscape + - transform.HTMLUnescape +aliases: [/functions/htmlescape] +--- + +In the result `&` becomes `&` and so on. It escapes only: `<`, `>`, `&`, `'` and `"`. + +```go-html-template +{{ htmlEscape "Hugo & Caddy > WordPress & Apache" }} → "Hugo & Caddy > WordPress & Apache" +``` |