# Footnote anchor inside shortcode

**URL:** <https://discourse.gohugo.io/t/footnote-anchor-inside-shortcode/2742>\
**Category:** support\
**Tags:** footnotes\
**Created:** [February 20, 2016, 3:44pm UTC](https://discourse.gohugo.io/t/footnote-anchor-inside-shortcode/2742 "2016-02-20T15:44:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hxrts](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hxrts/32/1189_2.png) [@hxrts](https://discourse.gohugo.io/u/hxrts)\
**Post date:** [February 20, 2016, 3:44pm UTC](https://discourse.gohugo.io/t/footnote-anchor-inside-shortcode/2742/1 "2016-02-20T15:44:28Z")

</div>

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:

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

...

[^1]: ref one

```

– more complex ex:

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

text two [^2]
...

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

```

– basic block shortcode

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

```

– basic refblock shortcode

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

```

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [February 20, 2016, 4:59pm UTC](https://discourse.gohugo.io/t/footnote-anchor-inside-shortcode/2742/2 "2016-02-20T16:59:43Z")

</div>

That is not possible.

---

<div class="post-metadata">

**Author:** ![anon94623599](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@anon94623599](https://discourse.gohugo.io/u/anon94623599)\
**Post date:** [March 27, 2021, 8:28pm UTC](https://discourse.gohugo.io/t/footnote-anchor-inside-shortcode/2742/3 "2021-03-27T20:28:04Z")

</div>

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

```auto
markup:
  goldmark:
    renderer:
      unsafe: true  

```

The shortcode is the following

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

```

and the example is

```auto
{{% 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.

---

<div class="post-metadata">

**Author:** ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)\
**Post date:** [March 28, 2021, 12:35am UTC](https://discourse.gohugo.io/t/footnote-anchor-inside-shortcode/2742/4 "2021-03-28T00:35:50Z")

</div>

Archived on March 28, 2021, 12:35am UTC


