# Shortcode turns header into plain text

**URL:** <https://zola.discourse.group/t/shortcode-turns-header-into-plain-text/2114>\
**Category:** Support\
**Created:** [May 3, 2024, 2:37am UTC](https://zola.discourse.group/t/shortcode-turns-header-into-plain-text/2114 "2024-05-03T02:37:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RedstoneParadox](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/redstoneparadox/32/1196_2.png) [@RedstoneParadox](https://zola.discourse.group/u/RedstoneParadox)\
**Post date:** [May 3, 2024, 2:37am UTC](https://zola.discourse.group/t/shortcode-turns-header-into-plain-text/2114/1 "2024-05-03T02:37:01Z")

</div>

So I created the following shortcode to allow me to center text:

```html
<div style="width: 100%;" class="center-align">
    {{ body }}
</div>

```

For some reason, this causes headers to render as plaintext instead of as headers, and I don’t quite understand why. For example, the following will render as `#### Welcome to my Website!`

```md
{% center() %}
#### Welcome to my Website!
{% end %}

```

---

<div class="post-metadata">

**Author:** ![welpo](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/welpo/32/1087_2.png) [@welpo](https://zola.discourse.group/u/welpo)\
**Post date:** [May 6, 2024, 9:35pm UTC](https://zola.discourse.group/t/shortcode-turns-header-into-plain-text/2114/2 "2024-05-06T21:35:00Z")

</div>

Try using the [`markdown`](https://www.getzola.org/documentation/templates/overview/#markdown) and `safe` filters together:

```tera
<div style="width: 100%;" class="center-align">
    {{ body | markdown | safe }}
</div>

```

---

<div class="post-metadata">

**Author:** ![RedstoneParadox](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/redstoneparadox/32/1196_2.png) [@RedstoneParadox](https://zola.discourse.group/u/RedstoneParadox)\
**Post date:** [May 6, 2024, 10:04pm UTC](https://zola.discourse.group/t/shortcode-turns-header-into-plain-text/2114/3 "2024-05-06T22:04:37Z")

</div>

I believe I tried that earlier, but I guess it was in the wrong order. Anyways, it works now, thank you.

---

<div class="post-metadata">

**Author:** ![welpo](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/welpo/32/1087_2.png) [@welpo](https://zola.discourse.group/u/welpo)\
**Post date:** [May 6, 2024, 10:16pm UTC](https://zola.discourse.group/t/shortcode-turns-header-into-plain-text/2114/4 "2024-05-06T22:16:48Z")

</div>

Glad to hear!

> [@RedstoneParadox](#):
>
> I guess it was in the wrong order

[`safe`](https://keats.github.io/tera/docs/#safe) only works if it’s the last filter of the expression 🙂
