-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
self._test('%form(foo=bar id="myform")', "<form foo='{{ bar }}' id='myform'></form>") | ||
|
||
# multiple dicts | ||
self._test('%a(a="b"){:c => "d"} Stuff', "<a a='b' c='d'>Stuff</a>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, do you like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can think of no good use for it but also no reason to not support it since it's in the spec.. no?
@nicpottier have made few additional changes so please take another look |
…r parsing attribute values which are Haml
if value is None: | ||
rendered.append("%s" % name) # boolean attribute | ||
if name in ('id', 'class') or value in (None, False): | ||
# this line isn't recorded in coverage because it gets optimized away (http://bugs.python.org/issue2506) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicpottier @ericnewcomer @norkans7 just in case anyone runs into something similar - a line which is definitely hit, but not included in coverage because CPython optimizes it away.
.(foo=bar)
is compiled to<div foo="{{ bar }}"></div>
%a(title=@title){:href => @link.href} Stuff
.(foo=True)
as a boolean attribute, and.(foo=None)
as removing attributefoo
checked="checked"
in XHTML mode