Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions

View File

@@ -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