Node / Express / Mongo: How to render HTML attributes from dynamic content?

I created a simple blog using Node / Express / Mongo / Jade (and / or HAML.js). I used (and updated a bit) the blog app from this tutorial , which itself is an update to one of howtonode.org

I can display attributes such as links, etc., with the template engine just fine, but when I transfer data from db, none of the html renderings. I get HTML text prints. I suppose I need other node packages / modules for rendering "dynamic" content, but I don't know where to start.

+4
source share
1 answer

In jade, when you submit content you DO NOT want to be escaped, be sure to pass it as != Instead of =

BE VERY CAREFUL! If you don’t manually take apart the bad things, you can make your site extremely vulnerable.

You can read some more jade documents here.

+3
source

Source: https://habr.com/ru/post/1334442/


All Articles