I’m trying to use shortcodes, nested.
For instance, I have an aside shortcode and an abbr shortcode, and use them like this:
{{< aside >}}
The {{< abbr "GUI" >}} is *fantastic*.
{{< /aside >}}
Hoping to get this result:
<aside>
The <abbr>GUI</abbr> is <strong>fantastic</strong>.
</aside>
However, I get this result:
<aside>
The <!-- raw HTML omitted -->GUI<!-- raw HTML omitted --> is <strong>fantastic</strong>.
</aside>
How can I allow a shortcode to be passed content, that it’ll parse as Markdown, allowing shortcodes to be used? Essentially, treating that content just like top-level content is treated in a Markdown page.
Sources
Here’s aside.html:
<aside>
({{ $.Page.RenderString .Inner }})
</aside>
And abbr.html:
{{- /**/ -}}
<abbr>{{ .Get 0 }}</abbr>
{{- /**/ -}}
Alternatives tried
Of note, I do not wish to disable safe HTML rendering.
I’ve already tried printing .Inner directly, instead of passing it through $.Page.RenderString, but that has the opposite problem to the current solution: it properly renders the abbr shortcode, but lets the raw Markdown through.
I found this old thread that seems to indicate there is no solution, but that seems very surprising, and the thread is four years old: Shortcode - nested shortcode, multiple inner - #10 by PaulMuaddib