vendredi 17 avril 2015

Insert html in jade through res.render


Vote count:

0




Having a little problem with inserting pure html into Jade. I store html-formatted text in db. And router takes these data and sends to the jade template. For the moment the output html i recieve is:



<p>some text</p>
<p>some text</p>


In jade template i get data in this way:



| #{content}
div #{content2}


And the router send it this way:



admin.query("SELECT * FROM `Article` WHERE `ArticleId` = " + req.params.id + ";", function (err, data) {
res.render('static.jade', {
'title' : data[0].ArticleTitle,
'page_title' : data[0].ArticleTitle,
'content' : data[0].ArticleContent,
'content2' : data[0].ArticleContent
});
});


I hope there is the way to fix it. That's gonna be big problem storing jade-formatted text in db. Regards for any help.



asked 1 min ago







Insert html in jade through res.render

Aucun commentaire:

Enregistrer un commentaire