totaljs / Tangular

A simple JavaScript template engine like Angular.js for websites or node.js
MIT License
61 stars 21 forks source link

Prevent HTML tag escape #16

Closed ptorrent closed 2 years ago

ptorrent commented 2 years ago

Hello,

Is there a way to prevent HTML tag to be escaped ?

Tangular.render('fdsfsdfsd {{ok}}',{ ok : '<span style="color:red;">yes</span>'})
18:33:18.463 'fdsfsdfsd <span>&lt;span style=&quot;color:red;&quot;&gt;yes&lt;/span&gt;</span>'

Thanks for your help

petersirka commented 2 years ago

It's easy: {{ ok | raw }}. More information here: https://docs.totaljs.com/components/40d06002lm50c/

ptorrent commented 2 years ago

awesome support, working well

Thanks