| 1 |
--- |
| 2 |
title: Plain |
| 3 |
description: Returns the rendered content of the given page, removing all HTML tags. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
params: |
| 7 |
functions_and_methods: |
| 8 |
returnType: string |
| 9 |
signatures: [PAGE.Plain] |
| 10 |
--- |
| 11 |
|
| 12 |
The `Plain` method on a `Page` object renders Markdown and [shortcodes](g) to HTML, then strips the HTML [tags][]. It does not strip HTML [entities][]. |
| 13 |
|
| 14 |
To prevent Go's [`html/template`][] package from escaping HTML entities, pass the result through the [`htmlUnescape`][] function. |
| 15 |
|
| 16 |
```go-html-template |
| 17 |
{{ .Plain | htmlUnescape }} |
| 18 |
``` |
| 19 |
|
| 20 |
[`html/template`]: https://pkg.go.dev/html/template |
| 21 |
[`htmlUnescape`]: /functions/transform/htmlunescape/ |
| 22 |
[entities]: https://developer.mozilla.org/en-US/docs/Glossary/Entity |
| 23 |
[tags]: https://developer.mozilla.org/en-US/docs/Glossary/Tag |