Nested shortcodes render Markdown in HTML content file

Here is a sample repo: GitHub - fnordfish/hugo-shortcode-nesting-test

As expected, Markdown will not be interpreted in a html content files. Even when using {{% %}} shortcodes.
But when shortcodes get nested, the inner shortcode suddenly interprets markdown:

No **markdown** here
{{% shortcode %}}No **markdown** here{{% /shortcode %}}
{{% wrap %}}
  {{% shortcode %}}But  **markdown** here ☹️{{% /shortcode %}}
{{% /wrap %}}

Is that a know/expected/deliberate limitation of nested shortcodes, or a bug/feature regression?

I realize that the quick-fix would be to use {{< >}}, but I’d like to understand the reason for this behavior. I also appreciate the % notation in HTML context because it does not look like HTML, making life easier for code highlighters.


I can circumvent the issue, if my shortcode explicitly renders .Inner as HTML like this:

<div class="shortcode">{{ .Inner | .Page.RenderString (dict "markup" "html") }}</div>

And enable usafe markdown render in hugo.yaml:

      unsafe: true

However, that only works if you really only need HTML and never render markdown.