Search code examples
node.jsejsfroala

Froala with ejs does not dissolve tags


I want to use an rich-text editor inside node. Now i have froala and I can edit text inside a textarea. But if I want to display with ejs <div><%= post.bio %></div> its not encoded. it looks like <p style="text-align: left;">Viele bekannte K&uuml;nstler verneigen sich ehrf&uuml;rchtig vor der Arbeit von Johannes Gr&uuml;tzke. Er ist f&uuml;r sie Vorbild, Vorreiter und einfach der genialste Maler mit unverwechselbarer Sicherheit in der Pinself&uuml;hrung (its german text). So all tag are shown i the text. How can I fix this?


Solution

  • Yes, because when you use <%= %> you have escaped from html tags. Try to use <%- %> when you want to display html output.