Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The depth of nested mixin is limited? #1999

Closed
gabrielbiga opened this issue Jun 17, 2015 · 5 comments
Closed

The depth of nested mixin is limited? #1999

gabrielbiga opened this issue Jun 17, 2015 · 5 comments

Comments

@gabrielbiga
Copy link

I'm having a problem with nested mixin.

mixin opa(id)
  #opa(xx=id)
    block

mixin opa2(id)
  #opa(xx=id)
    block

mixin opa3(id)
  #opa(xx=id)
    block

mixin opa4(id)
  #opa(xx=id)
    block

mixin opa5(id)
  #opa(xx=id)
    block

mixin opa6(id)
  #opa(xx=id)
    block    

mixin opa7(id)
  #opa(xx=id)
    block    

+opa(12)
  +opa2(13)
    +opa3(14)
      +opa4(15)
        +opa5(16)
          | xx
          +opa6(17)
            | xx
            +opa7(18)
              | zo

Where is "zo"?
I'm doing wrong or its a bug?

@jeromew
Copy link
Contributor

jeromew commented Jun 17, 2015

just a passing remark. is it normal that you only have 1 space between opa3 and opa4 ? It seems to me that this is not valid

@gabrielbiga
Copy link
Author

Even adding the space, the problem remains...

@jeromew
Copy link
Contributor

jeromew commented Jun 17, 2015

don't ask my why you can check on http://jade-lang.com/demo/ the compiled javascript

your bug comes from the fact that you have trailing tabs/spaces after "block" in opa6 and opa7. This leads to block && block() not beeing inserted in the compiled javascript

@ForbesLindesay
Copy link
Member

Minimal example of bug

mixin m(id)
  div
    block    

+m()
  | This text should appear

Should render:

<div>This text should appear</div>

but actually renders:

<div></div>

This is a bug.

ForbesLindesay pushed a commit to pugjs/pug-lexer that referenced this issue Jun 22, 2015
@ForbesLindesay
Copy link
Member

The fix for this is ready and will be released as part of 2.0.0

@TimothyGu TimothyGu added this to the 2.0.0 milestone Aug 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants