Jade Html Escaped String
I have a problema with Jade, I take an unescaped string from db (something like this: '<mo>&' this string can contain some html code, I pass the string to the
Solution 1:
I've set up default
express
app which usesjade
as its template engine.Modified
routes -> index.js
to pass some encoded text
router.get('/', function(req, res) {
res.render('index', { title: 'Express', encodedText: '<mo>&' });
});
- Modified
views -> index.jade
to display this text
block content
h1= title
p Welcome to #{title}
p Encoded text !{encodedText}
- Result seems to be OK
Post a Comment for "Jade Html Escaped String"