node.js - New line in express.js message -


is possible make new line in message notification?

"\n" or "\r\n" disappear there's no new line set. tried var endofline = require('os').eol; instead of \n. doesn't work sadly.

res.render('settings.ejs', {         user: req.user,         isauthenticated: true,         message: 'changed user(s):' + changearray + '\n(notice: can\'t affect users higher settingrights.)'         }); 

probabbly stupid/easy question don't working... in advance.

you can use html tags. reason why not getting displayed because suppose must using escaped text. need use unescaped syntax if want render tags in html string:

res.render('settings.ejs', {         user: req.user,         isauthenticated: true,         message: 'changed user(s):' + changearray + '<br />(notice: can\'t affect users higher settingrights.)'         }); 

here's how display unescaped text in view:

<%- message %> 

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -