mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-01 19:03:02 -05:00
17 lines
469 B
Markdown
17 lines
469 B
Markdown
---
|
|
title: htmlEscape
|
|
description: Returns the given string with the reserved HTML codes escaped.
|
|
categories: [functions]
|
|
menu:
|
|
docs:
|
|
parent: functions
|
|
keywords: [strings, html]
|
|
signature: ["htmlEscape INPUT"]
|
|
relatedfuncs: [htmlUnescape]
|
|
---
|
|
|
|
In the result `&` becomes `&` and so on. It escapes only: `<`, `>`, `&`, `'` and `"`.
|
|
|
|
```go-html-template
|
|
{{ htmlEscape "Hugo & Caddy > WordPress & Apache" }} → "Hugo & Caddy > WordPress & Apache"
|
|
```
|