# Shortcode - markdown vs html vs table of content

**URL:** <https://discourse.gohugo.io/t/shortcode-markdown-vs-html-vs-table-of-content/18282>\
**Category:** support\
**Created:** [April 24, 2019, 2:24pm UTC](https://discourse.gohugo.io/t/shortcode-markdown-vs-html-vs-table-of-content/18282 "2019-04-24T14:24:07Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![lar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/lar/32/8569_2.png) [@lar](https://discourse.gohugo.io/u/lar)\
**Post date:** [April 24, 2019, 5:36pm UTC](https://discourse.gohugo.io/t/shortcode-markdown-vs-html-vs-table-of-content/18282/5 "2019-04-24T17:36:27Z")

</div>

Yes, that works! Very cool! Thanks! 🙂 (But is it a hack or actually a good solution that should be in the docs? 🙂 For one thing I’ve seen @bep advise against using “{{%” due to unpredictable behavior of the blackfriday markdown renderer…)

Trying to avoid changing the template I came up with this (a nested div and three printf:s to avoid a oneliner):

```auto
 {{ printf "<div class=\"style1\">" | htmlUnescape | safeHTML }}
 {{ printf "<div class=\"style2 style3 \">%s</div>" .Inner | htmlUnescape | safeHTML }}
 {{ printf "</div>" | htmlUnescape | safeHTML }}

```

And it works!

> It’s crucial to have 1-3 space before the first `{{`. zero or four spaces won’t work. But I’m not sure why!

---

_[View the full topic](https://discourse.gohugo.io/t/shortcode-markdown-vs-html-vs-table-of-content/18282)._
