Update trim description with note on whitespace

This commit is contained in:
Ryan Watters
2017-04-05 18:31:18 -05:00
parent fe78595c89
commit ce428a9cca
+6 -1
View File
@@ -28,10 +28,15 @@ deprecated: false
{{ 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" }}
```
{{% 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 (`-`).
{{% /note %}}
[shortcodevars]: /variables/shortcodes/