mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-02 04:59:09 -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"
|
|
```
|