I'm using Jade in my latest node.js app. I'd like to have a long block of text in a textarea by default.
If I do something like this:
textarea(id="theTextarea")
it renders just fine:
<textarea id="theTextarea"></textarea>
However, if I do something like so:
textarea(id="theTextarea")
Hello world.
I get this:
<textarea id="theTextarea">
<hello>world</hello>
</textarea>
But I'd like it to be like so:
<textarea id="theTextarea">
hello, world
</textarea>
Any ideas?
textarea(id="theTextarea")
| Hello
| world.
| Hello
| moon.
| Hello
| sun.
You can also do this, if you don't want a lot of pipes "clogging up" your markup (notice the dot character after the closing parens):
textarea(id="theTextarea").
Hello
world.
Hello
moon.
Hello
sun.
Read through the Tag Text section in the Jade docs for more information.
The | worked great for me. In my case though, I needed to get the value from a js variable (passed via render local variables). This is what I ended up with:
textarea#resp( name="resp", rows="6", cols="66" )
| #{respStr}
I hope that helps someone.