javascript - Converting a newline from JS to HTML with Node.js -


supposing have object data defined follows:

res.render('index', {     data: 'line one\nline two' }); 

how can render value in html (by using jade template engine) splitting text on 2 lines?

note: using \<br\> instead of \n, still doesn't work.

try

res.render('index', {     data: 'line 1 <br/> line two' }) 

and in index.jade

  != data 

Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -