mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
Merge commit 'e509cac533600cf4fa8382c9cdab78ddd82db688'
This commit is contained in:
24
docs/content/en/functions/transform/HTMLEscape.md
Normal file
24
docs/content/en/functions/transform/HTMLEscape.md
Normal file
@@ -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"
|
||||
```
|
Reference in New Issue
Block a user