Welcome to mirror list, hosted at ThFree Co, Russian Federation.

htmlEscape.md « functions « en « content - github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 652492c72d3696baf85763517e7fcc1b669e8f40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
title: htmlEscape
linktitle:
description: Returns the given string with the reserved HTML codes escaped.
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
categories: [functions]
menu:
  docs:
    parent: "functions"
keywords: [strings, html]
signature: ["htmlEscape INPUT"]
workson: []
hugoversion:
relatedfuncs: [htmlUnescape]
deprecated: false
aliases: []
---

In the result `&` becomes `&amp;` and so on. It escapes only: `<`, `>`, `&`, `'` and `"`.

```
{{ htmlEscape "Hugo & Caddy > WordPress & Apache" }} → "Hugo &amp; Caddy &gt; WordPress &amp; Apache"
```