Footnotes are not rendered as expected in nested shortcodes

Codes

{{% outer %}}
footnote[^1]
{{% inner %}}
footnote[^1]
{{% /inner %}}
{{% /outer %}}

[^1]: footnote 1

outer.html:

{{ .Inner }}

inner.html:

{{ .Inner }}

Result

image

.RenderString and markdownify in inner.html didn’t help.

markdown

{{% outer %}}
footnote[^1]
{{< inner >}}
footnote[^2]
{{< /inner >}}
{{% /outer %}}

...
...

[^1]: footnote 1
[^2]: footnote 2

layouts/shortcodes/inner.html

{{ .Inner }}

layouts/shortcodes/outer.html

{{ .Inner }}