Do I have to use   for space in Jade?

Viewed 44329

I am using Jade and everything is cool except that Jade "eats" my spaces.

For example, in HTML:

<b>Hello</b> <b>World</b>

or

<b>Hello</b>
<b>World</b>

Will have a space between "Hello" and "World".

But when converting to Jade it'd be

b Hello
b World

When rendered as HTML, the space is gone. Like:

<b>Hello</b><b>World</b>

Do I have to add &nbsp; in my Jade template or is there any way I can get a normal space in the generated HTML?

6 Answers

if you want it like this

<b>Hello</b>&nbsp;<b>World</b>

You should use this

b Hello
|&nbsp;
b World

Here is a simpler way:

b Hello #{' '}
b world

This way it will be rendered with space between words:

b Hello <-- single space at the end
b world

Or use pipe with single space (no need for 2 spaces)

b hello
| <-- single space
b world
Related