-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
Selector starting with new line throws error #1414
Labels
bug
Something isn't working
Comments
syi0808
added a commit
to syi0808/happy-dom
that referenced
this issue
Jul 27, 2024
syi0808
added a commit
to syi0808/happy-dom
that referenced
this issue
Jul 28, 2024
capricorn86
added a commit
to syi0808/happy-dom
that referenced
this issue
Aug 29, 2024
…l white-space characters in selectors
Thank you for reporting @rothsandro! 🙂 Big thanks to @syi0808 for providing with a fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
If selector that starts with a new line, Happy DOM throws an error "Invalid selector".
To Reproduce
I forked the happy-dom repro and added a test in
QuerySelector.test.ts
.Clone the repro, switch to the
bug/selector-with-new-line
branch and run the tests.Repro: https://github.com/rothsandro/happy-dom/tree/bug/selector-with-new-line
Test: https://github.com/rothsandro/happy-dom/blob/bug/selector-with-new-line/packages/happy-dom/test/query-selector/QuerySelector.test.ts#L1090-L1098
Expected behavior
The selector should work because it's valid and works in the browser.
Device:
Additional context
A third-party component library that we use in our application uses such a selector. Because of that we cannot test parts of our app because it would result in this error.
The text was updated successfully, but these errors were encountered: