maartenpaauw
maartenpaauw

Reputation: 624

Pug - space before or after word / element

I have this paragraph element with text and 2 hyperlink elements inside it.

p
    | Favicon made by
    |
    a(href="http://www.niceandserious.com/", target="_blank") www.niceandserious.com
    |
    | from
    |
    a(href="http://www.flaticon.com/", target="_blank") www.flaticon.com
    | .

This will render the following output.

<p>Favicon made by <a href="http://www.niceandserious.com/" target="_blank">www.niceandserious.com</a> from <a href="http://www.flaticon.com/" target="_blank">www.flaticon.com</a>.</p>

Is it possible to get a space after or before a word / element without having the | ?

Upvotes: 0

Views: 592

Answers (1)

strah
strah

Reputation: 6722

This works for me. Just add #{' '} where you need a space.

p Favicon made by 
    a(href="http://www.niceandserious.com/", target="_blank")= "www.niceandserious.com"
    |#{' '}from 
    a(href="http://www.flaticon.com/", target="_blank") www.flaticon.com
    |.

Upvotes: 1

Related Questions