aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/content/en/functions/transform/HTMLEscape.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/en/functions/transform/HTMLEscape.md')
-rw-r--r--docs/content/en/functions/transform/HTMLEscape.md24
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 `&amp;` and so on. It escapes only: `<`, `>`, `&`, `'` and `"`.
+
+```go-html-template
+{{ htmlEscape "Hugo & Caddy > WordPress & Apache" }} → "Hugo &amp; Caddy &gt; WordPress &amp; Apache"
+```