From 69df4fc228ea1a01d17836bc9e38f7dc992e4a2f Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sun, 6 Aug 2023 11:28:15 -0700 Subject: [PATCH] Clarify how to determine if .Inner is populated --- content/en/templates/shortcode-templates.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/en/templates/shortcode-templates.md b/content/en/templates/shortcode-templates.md index f293b6d52..6a6700380 100644 --- a/content/en/templates/shortcode-templates.md +++ b/content/en/templates/shortcode-templates.md @@ -94,7 +94,13 @@ most helpful when the condition depends on either of the values, or both: #### `.Inner` -If a closing shortcode is used, the `.Inner` variable will be populated with the content between the opening and closing shortcodes. If a closing shortcode is required, you can check the length of `.Inner` as an indicator of its existence. +If a closing shortcode is used, the `.Inner` variable will be populated with the content between the opening and closing shortcodes. To check if `.Inner` contains anything other than white space: + +```go-html-template +{{ if strings.ContainsNonSpace .Inner }} + Inner is not empty +{{ end }} +``` A shortcode with content declared via the `.Inner` variable can also be declared without the content and without the closing tag by using the self-closing syntax: