S
S
StopDesign2014-06-17 09:37:10
HTML
StopDesign, 2014-06-17 09:37:10

How to put a space in Jade?

You need to make this HTML.

<div class="b-tags-list">
    <a href="#">Один</a>,
    <a href="#">Два</a>,
    <a href="#">Три и четыре</a>
</div>

Jade is used as a template engine, which produces something like this code:
.b-tags-list
  a(href="#") Один
  |,
  a(href="#") Два
  |,
  a(href="#") Три и четыре
  |,

The problem is that many editors eat spaces at the end of a line (strip trailing whitespace on save). The result is HTML without a space after the comma. How can this be fixed? I cannot use non-breaking spaces in this case.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
felixexter, 2014-06-21
@StopDesign

.b-tags-list
    a(href="#") Один
    =', '
    a(href="#") Два
    =', '
    a(href="#") Три и четыре
    =', '

K
Konstantin Velichko, 2014-06-17
@Zoxon

I have not seen a single editor that would “eat spaces”, set yours correctly

L
Lisonok, 2014-06-17
@Lisonok

Do it like this

doctype html
html(lang="en")
  span text
    = '    '
  div

did not notice above already there was the same answer (

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question