Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't render simple html inside an expression #141

Open
andrew-dotson opened this issue Dec 26, 2022 · 2 comments
Open

Can't render simple html inside an expression #141

andrew-dotson opened this issue Dec 26, 2022 · 2 comments

Comments

@andrew-dotson
Copy link

andrew-dotson commented Dec 26, 2022

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.

@cossssmin
Copy link
Member

cossssmin commented Dec 26, 2022

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

@andrew-dotson
Copy link
Author

andrew-dotson commented Dec 26, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants