bsr bsr - 5 months ago 30
Node.js Question

Jade : New warning on multiple attributes

I have updated jade to latest version, and started seeing this message in console

You should not have jade tags with multiple attributes

It is mentioned as feature, here

0.33.0 / 2013-07-12
Hugely more powerful error reporting (especially with compileDebug set explicitly to true)
Add a warning for tags with multiple attributes

and I see it in the code.

But, what does it really signify. When will I get this warning. For example, when will I get error based on the below code (It works without warning, but to like to know when will I get error so that I can compare with my code)

mixin link(href, name)
a(class=attributes.class, href=href)= name
a(href=href, attributes)= name

+link('/foo', 'foo')(class="btn")


Multiple "attributes" doesn't mean what you probably think it means. It's not an HTML attribute as we know it, but a token of type "attribute".



Note how I have two attribute sections, each with one attribute.

Better put them in one attribute section:

a(href="#WAT", title="WAT").some-class