# Enable \`unsafe=true\` for a single page

**URL:** <https://discourse.gohugo.io/t/enable-unsafe-true-for-a-single-page/24415>\
**Category:** support\
**Created:** [April 2, 2020, 7:09pm UTC](https://discourse.gohugo.io/t/enable-unsafe-true-for-a-single-page/24415 "2020-04-02T19:09:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![crem](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/crem/32/10940_2.png) [@crem](https://discourse.gohugo.io/u/crem)\
**Post date:** [April 2, 2020, 7:09pm UTC](https://discourse.gohugo.io/t/enable-unsafe-true-for-a-single-page/24415/1 "2020-04-02T19:09:10Z")

</div>

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

[Here](https://gohugo.io/content-management/front-matter/#override-global-markdown-configuration) 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:

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

```

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [April 2, 2020, 7:23pm UTC](https://discourse.gohugo.io/t/enable-unsafe-true-for-a-single-page/24415/2 "2020-04-02T19:23:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![crem](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/crem/32/10940_2.png) [@crem](https://discourse.gohugo.io/u/crem)\
**Post date:** [April 2, 2020, 8:07pm UTC](https://discourse.gohugo.io/t/enable-unsafe-true-for-a-single-page/24415/3 "2020-04-02T20:07:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![crem](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/crem/32/10940_2.png) [@crem](https://discourse.gohugo.io/u/crem)\
**Post date:** [April 3, 2020, 11:56am UTC](https://discourse.gohugo.io/t/enable-unsafe-true-for-a-single-page/24415/4 "2020-04-03T11:56:17Z")

</div>

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:

```auto
{{< unsafe >}}
   <div class="special-formatting">
{{< /unsafe >}}
blah blah
{{< unsafe >}}
   </div>
{{< /unsafe >}}

```

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [April 5, 2020, 11:56am UTC](https://discourse.gohugo.io/t/enable-unsafe-true-for-a-single-page/24415/5 "2020-04-05T11:56:18Z")

</div>

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