How to break line within <%= here is a string %>
If I receive from my client a string with "Hello\nHow are you?"...
Then:
1) If I do the job to replace \n by <\br> then the string that appears on the browser is:
Hello<\br>How are you?
2) If I don't replace anything, then (of course :) the string in the browser is:
Hello\nHow are you?
So my question is:
How you guys handle the line breaking without going to go for too complex code in .ejs placeholders?
Thanks,
Sebastien
PS: <\br> is not the right html tag for break line, I write it like this to keep it displayed in this editor
关闭于 2016-04-04 25 条评论