-
-
Notifications
You must be signed in to change notification settings - Fork 59
Add boolean/flag attribute shorthand to attribute syntax #372
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
Open
dereuromark
wants to merge
1
commit into
jgm:main
Choose a base branch
from
dereuromark:boolean-attribute-shorthand
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Really, HTML is one possible output only. If mentioned in a general specification of a markup, it's at best as an example.
This being said, why would it be equivalent to key=""` (an empty string value is not necessarily a boolean in a general context)?
Uh oh!
There was an error while loading. Please reload this page.
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.
You can also write it as key="key"
The HTML5 specs are interesting here, and a bit weird at first glance for sure.
But they bool concept is quite handy and useful in such places here. I think it also works as agnostic one, or translated well enough to it.
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.
Hmm... the only agnostic and semantically clear way would be, for me, key (standalone) being equivalent to key=true.
A HTML renderer may interpret key=true as key in output, and remove key=false, but that's an HTML concept (that doesn't really makes any sense beyond a weird historical reason from SGML to HTML etc.). No?
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.
The good thing about the bool attr is that we do not need to care about the verbose form per "end use", incl HTML. We just use the simple bool form and it just works tm :)
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.
And key="" is really what it is, an empty string (not simplified)
Uh oh!
There was an error while loading. Please reload this page.
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.
There is no need at this point to debate this.
The bool attribute is exactly why this discussion becomes void then, solving it cleanly.
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 am not sure I understand what you mean here, the PR says:
I don't think this has to be the case. And if not debated now (for some reason), then it shouldn't be mentioned. Or did I miss the point?
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.
Yes ignore that part. That's html5 specific and not relevant for General usage. My bad.