-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable attributes without values #165
Comments
Note that
|
Other users had requested that As above, |
Boolean attributes represent their "true" state when present in an element, regardless of whether they have a value. The HTML Living Standard specifies:
This means both The minimized form ( Adjusting dominate to support the minimized form, though not strictly necessary, could make its output more idiomatic. You could support a global setting that affects the default rendering behavior ( Overall, it's not a big deal, but it's also an easy thing to fix, and doing so would align with how most HTML is written and rendered. |
I was previously against this because I thought it was not actually part of the spec, also it seemed like the OP was just trying to get it to work at all, and not a bug about particular styles. In any case, since https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 and https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes explicitly allow this, I'm happy to change the behavior |
It seems acceptable to also have attributes without values, e.g. the
controls
attribute for the video tag:https://www.w3schools.com/html/html5_video.asp
Is this possible with dominate? If so I am unable to figure out how.
If not, how about adding a rule that
attribute=None
is rendered as an attribute without a value?Right now
attribute=None
seems to be equivalent toattribute=False
which simply prevents the attribute from being rendered at all.The text was updated successfully, but these errors were encountered: