mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 08:18:30 +00:00
Update trim description with note on whitespace
This commit is contained in:
1 parent
fe78595c89
commit
ce428a9cca
1 file changed
+6
-1
@@ -28,10 +28,15 @@ deprecated: false
|
|||||||
{{ trim .Inner}}
|
{{ trim .Inner}}
|
||||||
```
|
```
|
||||||
|
|
||||||
Instead, the following example tells `trim` to remove extra new lines from the content contained in the `.Inner`, which has specific usage with [shortcodes](/templates/shortcode-templates/):
|
Instead, the following example tells `trim` to remove extra new lines from the content contained in the [shortcode `.Inner` variable][shortcodevars]:
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ trim .Inner "\n" }}
|
{{ trim .Inner "\n" }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{{% note %}}
|
||||||
Go templates also provide a simple [method for trimming whitespace](/templates/introduction/#whitespace) from either side of a Go tag by including a hyphen (`-`).
|
Go templates also provide a simple [method for trimming whitespace](/templates/introduction/#whitespace) from either side of a Go tag by including a hyphen (`-`).
|
||||||
|
{{% /note %}}
|
||||||
|
|
||||||
|
|
||||||
|
[shortcodevars]: /variables/shortcodes/
|
||||||
Reference in new issue
Block a user