RejectedSoftware Forums

Sign up

Extra whitespace in templates

Heylo!

I can't figure out how to get rid of the extra space in this case:

section#footer
    | Available on
    a(href="http://bitbucket.org") BitBucket
    | .

I would like to get rid of the space between "BitBucket" and "." in the resulting HTML.

Can't find anything useful about this in the Jade documentation. I must be missing something.

Thanks!

Re: Extra whitespace in templates

Am 14.02.2013 16:50, schrieb Matej Nanut:

Heylo!

I can't figure out how to get rid of the extra space in this case:

section#footer
   | Available on
   a(href="http://bitbucket.org") BitBucket
   | .

I would like to get rid of the space between "BitBucket" and "." in the resulting HTML.

Can't find anything useful about this in the Jade documentation. I must be missing something.

Thanks!

Currently the only way is to use inline HTML:

section#footer
    | Available on
    | <a href="http://bitbucket.org">BitBucket</a>.

I've also thought about avoiding a line-break (which causes the space in the rendered HTML) in case
text comes directly after the pipe, but didn't implement it (not sure if it really is a good idea).

Re: Extra whitespace in templates

While that sounds like a nice idea, we'd need a way to force a line break (or space, which is the same thing) in those cases. Maybe a #{" "} or something, heh.