# Isolation of links and footnotes inside codeblocks

**URL:** <https://discourse.gohugo.io/t/isolation-of-links-and-footnotes-inside-codeblocks/43795>\
**Category:** support\
**Tags:** footnotes\
**Created:** [April 8, 2023, 5:48am UTC](https://discourse.gohugo.io/t/isolation-of-links-and-footnotes-inside-codeblocks/43795 "2023-04-08T05:48:02Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [April 9, 2023, 10:14pm UTC](https://discourse.gohugo.io/t/isolation-of-links-and-footnotes-inside-codeblocks/43795/7 "2023-04-09T22:14:27Z")

</div>

1) Footnotes within inline code will never work. It is… code.

```auto
This is `inline code[^1]`.

```

2) Footnotes within indented code blocks will never work. It is… code.

```plaintext
    This is an indented code block.[^2]

```

3) Footnotes within fenced code blocks (those without a render hook) will never work. It is… code.

````plaintext
```go
This is a fenced code block.[^3]
```

````

4) Footnotes in a blockquote are rendered as expected.

```plaintext
> This is a blockquote.[^4]

```

5) Footnotes within a shortcode called using the `{{% foo %}}` notation are rendered as expected.

```plaintext
{{% foo %}}
This is **bold** text.[^4]
{{% /foo %}}

```

6) Footnotes within a shortcode called using the `{{< foo >}}` are rendered if both parts are passed through `.Page.RenderString` in the same call. Shortcodes called with this notation are rendered separately from the `.RawContent`, outside of the normal page flow, resulting in duplicate `id` attributes and positioned immediately after the shortcode call. **This is expected.**

```plaintext
{{< foo >}}
This is **bold** text.[^5]
[^5]: Footnote 5
{{< /foo >}}

```

7) Footnotes within a markdown render hook are rendered if both parts are passed through `.Page.RenderString` in the same call. The content is rendered separately from the `.RawContent`, outside of the normal page flow, resulting in duplicate `id` attributes and positioned immediately after the fenced code block. **This is expected.**

````plaintext
```blockquote
This is rendered by a code block render hook.[^6]
[^6]: Footnote 6
```

````

> [@Tom\_Durand](#):
>
> So is this a bug ?

No.

> [@Tom\_Durand](#):
>
> Or a limitation of Hugo in particular?

Sort of.

> [@Tom\_Durand](#):
>
> Or is there a way to parameterize it?

No.

---

_[View the full topic](https://discourse.gohugo.io/t/isolation-of-links-and-footnotes-inside-codeblocks/43795)._
