Closed domtra closed 8 years ago
:+1: Thank you for the contribution!
@domtra I am currently writing a test for this and found a bug:
div(class=foo).foo&attributes(dynamicAttributes)
will compile to
<div<?php
attr_class($foo, 'foo');
?>></div><div<?php
attrs(array(
"class" => "$foo foo"
), $dynamicAttributes);
?>></div>
Which are two div tag, the second wrong with a $
-prefixed classname.
@ivankravchenko I created this test so far: https://gist.github.com/FranzSkuffka/d8db91ffa1bdaeef25eecc40240d2146
I think the result should look something like this but I am not sure about the associative array comprehension of the attrs
function, but it does combines attributes with identic names, right?
When we remove any of the three components .foo
, class=foo
or &attributes(...)
in jade the output looks right as it does not add multiple classes within at attrs()
call in php
div(class=foo).foo&attributes(dynamicAttributes)
@domtra maybe you can look into it and add a test as well. :+1:
This is a fix for the mentioned bug in the discussion of #19.
I do not know if there needs to be some extra escaping for dynamic classes. Maybe we can discuss if this is a general solution or just works in our case when we have something like