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
[LiveComponent] Tokenize classes on all allowed whitespaces #1828
base: 2.x
Are you sure you want to change the base?
Conversation
I don't understand why |
Also, forgot to mention: I'd consider a regex to tokenize the string a more elegant solution. Any objections against that? |
Could you rebuild the packages ? (that's the origin of the CI failures) (yarn run build from the repository root i think) |
Of course! Didn't find anything in the docs and wasn't sure whether that's something that actually has to be done in the PR or will be done on release. |
Yep this would need some CONTRIB file.. i'll open an issue :) |
#1836 :) |
Do you think you could add a quick test, to prevent any future regression ? 😊 |
I would like to but I didn't see any browser tests in LiveComponents. Could you point me in the right direction where actual browser integration is tested for |
The class attribute can be tokenized by any white space as defined by the HTML spec. A class string containing new lines was not correctly cleaned / trimmed, resulting in incorrectly detected class changes and a browser error if empty classes or classes with newlines were applied. Fixes symfony#1819
292f19d
to
268b2df
Compare
Never mind. I figured LiveComponent doesn't have any browser tests yet and tried to add them. This PR got bigger than expected, please let me know if anything's missing. |
wow indeed :) I'll look in the week as soon as i can ! Thank you for the efforts :) |
The class attribute can be tokenized by any white space as defined by the HTML spec.
When a class attribute contains whitespaces other than a space change tracking fails and invalid classes are applied resulting in
Uncaught (in promise) DOMException: DOMTokenList.remove: The empty string is not a valid token.
.