Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes r2wc treat prop declared as
"boolean"
, i.e.with reasonable portion of semantics of HTML Boolean attribute (as described in https://developer.mozilla.org/en-US/docs/Glossary/Boolean/HTML) so it's still as backwards compatible as possible.
specified part is deliberately not obeyed by code I propose, as pre-existing behavior is very much different. With this PR values that were considered
false
before (e.g.0
,no
,false
,n
,f
, etc.) are still consideredfalse
this part is AFAIK followed faithfully.
Warning
There's one change of behavior that's to be discussed
when a
false
is assigned to propertyfoo
mapped as"boolean"
then attribute becomesfoo="false"
when a
false
is assigned to propertyfoo
mapped as"boolean"
then attribute becomes taken away entirelyIMO this change should be applied, but open to making that particular change later, on upcoming 3.0, when it's time, over holding the entire thing back until then.
This one also borrows some ideas from unfinished #123 by @shoumaw (handling booleans before running
transform.parse
, but not the deprecation of syntax defined as^[ty1-9]
).In fact: I ensured the current behavior with more tests - until it's actually decided that it should be dropped, I think it's worth having it secured
Fixes #162