jade icon indicating copy to clipboard operation
jade copied to clipboard

Parameters don't work on nested mixins

Open pipe01 opened this issue 2 years ago • 2 comments

For example:

mixin inner(foo)
    div Foo is #{foo}

mixin outer
    +inner("Bar")

+outer

Outputs this:

// Code generated by "jade.go"; DO NOT EDIT.

package views

import (
	"io"
)

const (
	index__0 = `<div>Foo is `
	index__1 = `</div>`
)

func Jade_index(wr io.Writer) {
	buffer := &WriterAsBuffer{wr}

	{
		{
			buffer.WriteString(index__0)
			WriteAll(foo, true, buffer)
			buffer.WriteString(index__1)
		}
	}

}

As you can see, inner's foo parameter isn't resolved which results in an undefined reference.

pipe01 avatar Sep 08 '23 21:09 pipe01

I see the same problem and don't have a workaround at the moment.

UnrealView avatar Oct 19 '23 14:10 UnrealView

I ended up writing my own library lol, there's absolutely no documentation though.

pipe01 avatar Oct 19 '23 14:10 pipe01