Skip to content
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

boolean attribute aren't correctly transformed to valid html #127

Open
wwylele opened this issue Nov 8, 2022 · 0 comments
Open

boolean attribute aren't correctly transformed to valid html #127

wwylele opened this issue Nov 8, 2022 · 0 comments

Comments

@wwylele
Copy link

wwylele commented Nov 8, 2022

html boolean values are represented by the presence or absence of the attribute (https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes), which means the following are correct html

<input type=checkbox>
<input type=checkbox disabled>

Additionally html also accepts the following

<input type=checkbox disabled="">   // I don't think the spec made it really clear but my browser interpret this as true
<input type=checkbox disabled="disabled"> // also means true

However, typed-html would generate the following

<input type=checkbox disabled="">  // for false, but this actually means true
<input type=checkbox disabled="true"> // for true, but this is invalid

I have wrote a hacky patch myself to fix this: wwylele@658a36f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant