From 13097daf2e22fabfdb7528ca8709e86dba2b4a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 18 Apr 2019 09:58:51 +0200 Subject: [PATCH] Update shortcode docs vs 0.55 --- content/en/content-management/shortcodes.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/content/en/content-management/shortcodes.md b/content/en/content-management/shortcodes.md index b719e681d..3be1c6f9e 100644 --- a/content/en/content-management/shortcodes.md +++ b/content/en/content-management/shortcodes.md @@ -53,12 +53,15 @@ The examples above use two different delimiters, the difference being the `%` ch ### Shortcodes with Markdown -The `%` character indicates that the shortcode's inner content---called in the [shortcode template][sctemps] with the [`.Inner` variable][scvars]---needs further processing by the page's rendering processor (i.e. markdown via Blackfriday). In the following example, Blackfriday would convert `**World**` to `World`: +In Hugo `0.55` we changed how the `%` delimiter works. Shortcodes using the `%` as the outer-most delimiter will now be fully rendered when sent to the content renderer (e.g. Blackfriday for Markdown), meaning they can be part of the generated table of contents, footnotes, etc. + +If you want the old behavior, you can put the following line in the start of your shortcode template: ``` -{{%/* myshortcode */%}}Hello **World!**{{%/* /myshortcode */%}} +{{ $_hugo_config := `{ "version": 1 }` }} ``` + ### Shortcodes Without Markdown The `<` character indicates that the shortcode's inner content does *not* need further rendering. Often shortcodes without markdown include internal HTML: