Joker / jade

Jade.go - pug template engine for Go (golang)
BSD 3-Clause "New" or "Revised" License
354 stars 37 forks source link

.variable #15

Closed jinxmcg closed 6 years ago

jinxmcg commented 7 years ago

{data.PageId} is not working the error is "is an incomplete template""

any idea how to fix?

Thanks

jinxmcg commented 7 years ago

I looked into it and it seems #{var} => {{var}} and html/template complains is no function "var" i think it should be converted to {{.var}} and it will work what do you think?

jinxmcg commented 7 years ago

Adding a "." to lines 209 in jade_node.go fixes it...still I do not know if it is correct the behaviour I suggested.

return fmt.Sprintf("%s", rex.ReplaceAll(l.Text, []byte("{{.$1}}"))) default: return fmt.Sprintf("\n"+idt+"%s", rex.ReplaceAll(l.Text, []byte("{{.$1}}")))