Display HTML in a variable using Jade

I have some text stored in a variable that contains some HTML. For example, a cat in a hat. However, when I show it in Jade, it appears with tags instead of formatting rendering. How can i fix this?

+52
Jun 25 2018-12-12T00:
source share
2 answers

Code buffered with = is escaped by default for security, but you can use! = To output unscreened return values!

p!= aVarContainingHTML 

Jade doc

+103
Jun 25 2018-12-12T00:
source share

The syntax you need is:

 !{yourJsVariable} 

if you use #{yourJsVariable} , it shows <>, but with !{} it is not.

+34
Mar 24 '16 at 11:42 on
source share



All Articles