# Using shortcode inside render-hook

**URL:** <https://discourse.gohugo.io/t/using-shortcode-inside-render-hook/42038>\
**Category:** support\
**Created:** [December 22, 2022, 7:16pm UTC](https://discourse.gohugo.io/t/using-shortcode-inside-render-hook/42038 "2022-12-22T19:16:53Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [December 22, 2022, 8:15pm UTC](https://discourse.gohugo.io/t/using-shortcode-inside-render-hook/42038/5 "2022-12-22T20:15:34Z")

</div>

When you call a shortcode using the `{{< foo >}}` notation, we do not render the shortcode before:

1. Sending the page content to the markdown renderer (Goldmark), or
2. Hooking into links, images, and headings

Instead, we send a placeholder, effectively something like this:

```auto
HAHAHUGOSHORTCODE-UNIQUE-ID

```

When we get this back from Goldmark, we replace the placeholder with the rendered shortcode.

But you can also force your shortcode to be rendered _before_ we send the page content to Goldmark (and before we hook into links, images, and headings) by using this notation:

```auto
{{% div %}}  

```

But, by default, Goldmark considers HTML in markdown unsafe, so it replaces the HTML with this HTML comment:

```plaintext
<!-- raw HTML omitted -->

```

To tell Goldmark that HTML in markdown is safe in your situation:

```auto
[markup.goldmark.renderer]
unsafe = true

```

---

_[View the full topic](https://discourse.gohugo.io/t/using-shortcode-inside-render-hook/42038)._
