Shortcode turns header into plain text

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

<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!

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

Try using the markdown and safe filters together:

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

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

1 Like

Glad to hear!

safe only works if it’s the last filter of the expression :slight_smile:

1 Like