I need to display a string containing \n
using Jade and I want to convert those characters in <br>
. I tried to do that in two ways:
- var s = 'text\nand\ntext';
p= string
p= string.replace(/\n/g, '<br />')
But in the first case I can't see spaces and with the second paragraph the HTML is escaped.
but the `html` var in your example should be rendered as `<script></script>` – Gio Polvara Nov 26 '12 at 09:16