Footnote anchor inside shortcode

Anyone had success placing a footnote using the blackfriday markdown syntax inside a shortcode? The shortcode syntax processing occurs prior to blackfriday, so this seems possible, just not familiar enough with the internals to understand the sequence exactly.

– ex:

{{% block %}}
text one [^1]
{{% /block %}}

...

[^1]: ref one

– more complex ex:

{{% block %}}
text one [^1]
{{% /block %}}

text two [^2]
...

[^1]: ref one {{% refblock %}}inner one{{% /refblock %}}
[^2]: ref two

– basic block shortcode

<div class="block">
{{ .Inner }}
</div>

– basic refblock shortcode

<div class="refblock">
{{ .Inner }}
</div>

That is not possible.

I know this is a very old question, but I spent quite a lot of time on this issue and therefore just wanted to post here for people with a similar issue.

With the new Goldmark rendering enginge, the first example now worked for me. In my Hugo configuration I use

markup:
  goldmark:
    renderer:
      unsafe: true  

The shortcode is the following

<div class="block">
{{ .Inner }}
</div>

and the example is

{{% block %}}
text one [^1]
{{% /block %}}

What cost me a lot of time is to that

  • The new lines in the shortcode are important, i.e.,
    <div class="block"> {{ .Inner }} </div>
    did not work for me.
  • I first tried to use <div class="block"> {{ .Inner | markdownify }} </div> and call the short code via `{{< …>}}. This did not work as it seems to render the markdown only with local context, not knowing the foodnotes defined in the whole document.

Maybe someone with a better understanding of Hugo can explain the reason for this behavior.