When you call a shortcode using the {{< foo >}}
notation, we do not render the shortcode before:
- Sending the page content to the markdown renderer (Goldmark), or
- Hooking into links, images, and headings
Instead, we send a placeholder, effectively something like this:
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:
{{% div %}}
But, by default, Goldmark considers HTML in markdown unsafe, so it replaces the HTML with this HTML comment:
<!-- raw HTML omitted -->
To tell Goldmark that HTML in markdown is safe in your situation:
[markup.goldmark.renderer]
unsafe = true