Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

multiple lines of piped text #29

Closed
dweldon opened this issue May 4, 2014 · 8 comments
Closed

multiple lines of piped text #29

dweldon opened this issue May 4, 2014 · 8 comments

Comments

@dweldon
Copy link

dweldon commented May 4, 2014

p
  | foo
  | bar

Produces:

<p>foobar</p>

Which I don't think is correct. The native jade compiler produces:

<p>
  foo
  bar
</p>

It would be nice if a space or a newline could be added automatically. Currently, the workaround is to add extra indentation after the second pipe which is a little annoying. Can this be fixed?

@mquandalle
Copy link
Owner

Yes I think that's an issue (BTW I've not checked jade behavior in this case).

We should also consider the following notation:

p.
  foo
  bar

@DenisGorbachev
Copy link

👍 this really bugs me down. Could you please fix it? :)

@DenisGorbachev
Copy link

By the way, Spacebars parser leaves all whitespace intact. Can Jade parser do the same?

@mquandalle
Copy link
Owner

I'm currently abroad but I plan to work on this when I get back home. I'll just add a space between two consecutive children, but I'll not leave whitespace intact like in Spacebars. What is your use case to do that?

@mquandalle mquandalle added the bug label May 21, 2014
@DenisGorbachev
Copy link

Bootstrap:

            a.dropdown-toggle(href="#", data-toggle="dropdown")
              | {{currentUser.profile.name}}
              | &nbsp;
              b.caret

Social buttons:

  .social
    .g-plusone(href="/" data-size="standard")
    | &nbsp;
    a.twitter-share-button(href='https://twitter.com/share', data-size="large", data-related='priestIO') Tweet
    | &nbsp;
    .fb-like.fb-button(data-layout='button_count', data-action='like', data-show-faces='true', data-share='false')

Bootstrap again:

              .col-lg-9.name
                h2
                  | #{name}
                  | &nbsp;
                  small #{number}

I agree that leaving whitespace strictly as written in template is not a goal; a single space or newline between nodes will do.

@DenisGorbachev
Copy link

WooHoo! Works perfectly now.

Thank you, Maxime! :)

@mquandalle
Copy link
Owner

Released in 0.2.3.

@dweldon
Copy link
Author

dweldon commented May 28, 2014

Thanks so much for fixing this! 😸

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants