mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'
This commit is contained in:
@@ -3,11 +3,11 @@ title: transform.XMLEscape
|
||||
description: Returns the given string, removing disallowed characters then escaping the result to its XML equivalent.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
aliases: []
|
||||
related: []
|
||||
returnType: string
|
||||
signatures: [transform.XMLEscape INPUT]
|
||||
params:
|
||||
functions_and_methods:
|
||||
aliases: []
|
||||
returnType: string
|
||||
signatures: [transform.XMLEscape INPUT]
|
||||
---
|
||||
|
||||
{{< new-in 0.121.0 />}}
|
||||
@@ -31,9 +31,9 @@ For example:
|
||||
|
||||
When using `transform.XMLEscape` in a template rendered by Go's [html/template] package, declare the string to be safe HTML to avoid double escaping. For example, in an RSS template:
|
||||
|
||||
{{< code file="layouts/_default/rss.xml" >}}
|
||||
```xml {file="layouts/_default/rss.xml"}
|
||||
<description>{{ .Summary | transform.XMLEscape | safeHTML }}</description>
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
[disallowed characters]: https://www.w3.org/TR/xml/#charsets
|
||||
[html entities]: https://developer.mozilla.org/en-us/docs/glossary/entity
|
||||
|
Reference in New Issue
Block a user