user3142695 user3142695 - 1 year ago 264
HTML Question

Add line break in textarea in a jade template

I need to output an array content in a textarea in a jade template. It is something simple like this:

each content

But I need to add a linebreak after each element, as I want to display each element in a own line in the textarea. How do I add the linebreak?

Answer Source

In JADE you can use expressions like \n, \s or \t in "Unescaped Buffered Code". Take a look into the Docs:

Here is an example Pen:

- var contents = {'line1': 'abcd\n', 'line2':'defg\n'}
   each content in contents
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download