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

Complete misbehaviour when using nested mixins and blocks #82

Open
xahon opened this issue Apr 7, 2024 · 1 comment
Open

Complete misbehaviour when using nested mixins and blocks #82

xahon opened this issue Apr 7, 2024 · 1 comment

Comments

@xahon
Copy link

xahon commented Apr 7, 2024

  • pypugjs version: 5.9.12
  • Django version: -
  • Python version: 3.11.3
  • Operating System: Windows 10

Description

Trying to make outer and inner parts of elements using mixins

Having these mixins

mixin parent(label)
    div #{label}
        if block
            block

mixin child(label)
    div #{label}
        if block
            block

Code

+parent("Parent 1")

generates html as expected

<div>Parent 1
</div>

Code

+parent("Parent 1")
    +child("Child 1")

doesn't generate any code at all, expected

<div>Parent 1
    <div>Child 1
    </div>
</div>

Code

+parent("Parent 1")
    +child("Child 1")

+parent("Parent 2")

Generates unexpected

<div>Child 1
</div>

Expected output

<div>Parent 1
    <div>Child 1
    </div>
</div>
<div>Parent 2</div>

Original pugjs generates all expected html with using these cases

@kakulukia
Copy link
Owner

Hi @xahon ,

i guess this library was never really supporting nested mixins and i personally never used mixins at all as im more or less creating my frontends in Vue which "does mixins" for me. If you are able to create a PR to fix this, im happy to merge it, tho!

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

No branches or pull requests

2 participants