Shortcodes with Markdown not rendering without newline

Hello,

When attempting to wrap my Markdown in a shortcode like the following, it doesn’t render properly (specifically, the h2 isn’t rendered).

{{% containers/box %}}
## Desktop

### Release Notes V1.8.95
...
{{% /containers/box %}}

If I add a new line after the opening shortcode snippet (like below), then it works as expected.

{{% containers/box %}}

## Desktop

### Release Notes V1.8.95
...
{{% /containers/box %}}

Is this expected behavior?

That would depend on what the shortcode does.

Here’s the shortcode:

{{- $tag := .Get 0 | default "div" -}}
{{- printf `<%v class="box">%v</%v>` $tag .Inner $tag | safeHTML -}}