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

Unexpected trimmed attribute selector value #17

Closed
KillyMXI opened this issue Mar 13, 2021 · 1 comment · Fixed by #33
Closed

Unexpected trimmed attribute selector value #17

KillyMXI opened this issue Mar 13, 2021 · 1 comment · Fixed by #33
Labels
bug Something isn't working

Comments

@KillyMXI
Copy link

KillyMXI commented Mar 13, 2021

Given the input [foo=ss][bar=ii] I'd expect two-letter value for each attribute selector.
Instead, one letter is interpreted as the case sensitivity modifier.

From a brief look I can't find any note about this corner case in HTML spec.

Browsers seem to follow more intuitive interpretation: if no quotes and no whitespace then it's a part of the value. (If no quotes and the first whitespace group is not followed by the single i or s character than the rule is ignored as invalid.)

I'd suggest to not consider the i or s character before closing ] as a modifier in case

  • either it is not preceded by a whitespace;
  • or it is not the only character after the first whitespace group.

The difference between implementations will be present in the output for [foo=s s s]. There is no intuitive best interpretation so it seems fine to have any, unlike the case with no spaces.

@LeaVerou LeaVerou added the bug Something isn't working label Mar 14, 2021
@LeaVerou
Copy link
Owner

Yup, that's definitely a bug. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants