Closed rulatir closed 1 year ago
Hello,
This fix is related to #86 with the aim to align to pugjs and to support the automatically seeded $attributes
array (coming from explicit attributes passed to the mixin call).
I think you could use:
mixin link()
- unset($attribs['href'])
a(href="#")&attributes($attribs)
link()(href="/")
This way you explicitly show that you ignore href
from $attribs
and you would get the desired output.
Is there a solution that doesn't require fixing a hundred views in a thousand places, each requiring careful consideration and debugging? Is it possible to write something that will do what &attributes()
used to do, and search/replace all occurrences of &attributes()
with it?
Hello, in the next version (can be already tested requiring composer require "phug/phug:dev-master as 1.12.0"
), the option 'attribute_precedence' => 'attribute',
can be used to give precedence to attributes over assignments, or 'attribute_precedence' => 'left',
to give priority to the most-left token.
Hello,
I encountered a breaking change between 1.8 and 1.9:
Assuming
$url === "foo"
and$attribs['href'] === "bar"
, in 1.8 I got:But in 1.9 I get:
Looks like in 1.8 explicitly specified attributes took precedence over the attributes bag, but in 1.9 it's just left-to-right, last one wins.