Closed ajcrites closed 11 years ago
This issue looks sharing the same problem with #10. Did you intend?
This issue is not the same as #10. There is no overlap between the issues. My sample code uses disabled
to exhibit the behavior, but disabled
is already on the current DOM Node List, so fixing the list will not fix this issue.
It may be debatable that this is an issue at all, but I feel that tal:attributes
should set boolean values properly if the output mode is HTML.
I understand what you mean. <input disabled>
was expected but actually <input disabled="1">
, although disabled
attribute defined.
Does below test explain what you mentioned? https://github.com/pornel/PHPTAL/blob/html5_with_ns/tests/TalAttributesTest.php#L178
Yes, that is correct.
Fixed in #12 .
If you set a boolean attribute on an element using
tal:attributes
, it will use the value of the variable instead of setting the boolean value. This results in invalid HTML for that attribute.The boolean attribute list is also incomplete for HTML5, but that is probably a separate issue.
To reproduce, use code/template like this:
When the template is emitted, it will specify
disabled="1"
, and this does not validate at least for HTML5. If you set a boolean attribute without usingtal:attributes
, it will be set properly.