Enable `unsafe=true` for a single page

Is it possible to override markdown configuration (unsafe=true) for a single page?

Here the documentation suggests it’s possible, but I cannot find any detailed description.

I tried adding this to content’s front matter (and various variations of it), but it didn’t help:

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

The passage you reference refers to BlackFriday, the old renderer.

Yeah but I hoped that if there’s a way to override global config, it may somehow automatically work for Goldmark too…

I’ve solved my issue differently, but I’ve just realized that it’s possible to have unsafe shortcode that would just contain {{ .Inner }}, that way it’s possible to insert html tags without even setting unsafe=true for the entire page.

E.g.

  1. Create layout/shortcodes/unsafe.html with the following content: {{ .Inner }}.
  2. In markdown use it like this:
{{< unsafe >}}
   <div class="special-formatting">
{{< /unsafe >}}
blah blah
{{< unsafe >}}
   </div>
{{< /unsafe >}}

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.