posthtml-expressions icon indicating copy to clipboard operation
posthtml-expressions copied to clipboard

Can't render simple html inside an expression

Open andrew-dotson opened this issue 2 years ago • 2 comments

Not sure why this does not work. I tried the {{{}}} option as well. I am kinda a new to this but was hoping someone could point me in the right direction...

{{text ? '<strong>yes</strong>': ''}}

am I missing something? it just shows written out in the browser instead of actually rendering the html.

andrew-dotson avatar Dec 26 '22 03:12 andrew-dotson

Use triple braces {{{text ? '<strong>yes</strong>': ''}}} to unescape the tags.

cossssmin avatar Dec 26 '22 09:12 cossssmin

@cossssmin Hmm for some reason that does not work for me, is there any options that need to be set? I am using parcel and a posthtmlrc file. For some reason anytime I include html in a string it does not work, but everything else does...

Different example: {{{'<strong>yes</strong>'}}}

The above example literally just shows {{{'<strong>yes</strong>'}}} in the browser window.

But when I remove the strong tags everything works like normal and it doesn't show the "{{{" in the browser.

andrew-dotson avatar Dec 26 '22 23:12 andrew-dotson