How can I display marked up string data in a Meteor template?
I need to display a string from my database that contains some basic HTML tags such that the resulting text is properly formatted. It currently just displays the markup text.
Here's the relevant part of the template:
<span class="description">{{description}}</span>
Where {{description}} is the string containing markup (like "hello<br>world").
I'd like it to display
hello
world
rather than
hello<br>world
I guess this would be similar to using innerHTML in javascript.
Thanks in advance!
To override HTML-escape in Handlebars, use the triple-stash:
<span class="description">{{{description}}}</span>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With