summaryrefslogtreecommitdiffstats
path: root/docs/content/en/methods/page/Plain.md
blob: 65d11166e0a83290375e3f3b57b54d370d987d5b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
title: Plain
description: Returns the rendered content of the given page, removing all HTML tags.
categories: []
keywords: []
params:
  functions_and_methods:
    returnType: string
    signatures: [PAGE.Plain]
---

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].

To prevent Go's [html/template] package from escaping HTML entities, pass the result through the [`htmlUnescape`] function.

```go-html-template
{{ .Plain | htmlUnescape }}
```

[html/template]: https://pkg.go.dev/html/template
[entities]: https://developer.mozilla.org/en-US/docs/Glossary/Entity
[tags]: https://developer.mozilla.org/en-US/docs/Glossary/Tag
[`htmlUnescape`]: /functions/transform/htmlunescape/