Miscellaneous edits

This commit is contained in:
Joe Mooring authored and GitHub committed 2023-12-05 09:05:07 -08:00
1 parent 8c3700d128
commit e4eb484575
9 files changed
+29 -23

No files matched your search

+3 -1
View File
@@ -10,6 +10,8 @@ action:
signatures: [transform.XMLEscape INPUT]
---
{{< new-in 0.121.0 >}}
The `transform.XMLEscape` function removes [disallowed characters] as defined in the XML specification, then escapes the result by replacing the following characters with [HTML entities]:
- `"` → `&#34;`
@@ -24,7 +26,7 @@ The `transform.XMLEscape` function removes [disallowed characters] as defined in
For example:
```go-html-template
transform.XMLEscape "<p>abc</p>" → &lt;p&gt;abc&lt;/p&gt;
{{ transform.XMLEscape "<p>abc</p>" }} → &lt;p&gt;abc&lt;/p&gt;
```
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: