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

DOMException is thrown for substring matching attribute selectors with whitespaces #911

Closed
romansp opened this issue May 11, 2023 · 0 comments · Fixed by #913
Closed

DOMException is thrown for substring matching attribute selectors with whitespaces #911

romansp opened this issue May 11, 2023 · 0 comments · Fixed by #913
Assignees
Labels
bug Something isn't working

Comments

@romansp
Copy link
Contributor

romansp commented May 11, 2023

Describe the bug
DOMException: Invalid selector is thrown for attribute selector with spaces, e.g. a[href]:not([href *= "javascript:" i]). Notice whitespace around *=. This selector is valid in browser environment.

To Reproduce
Steps to reproduce the behavior:

  1. Execute document.querySelectorAll('a[href]:not([href *= "javascript:" i])'); in happy-dom environment.

Expected behavior
Selector a[href]:not([href *= "javascript:" i]) should be considered correct.

Device:

  • Version 9.15.0

Additional context
Doesn't throw in version 9.11.0, regression introduced in 9.12.0.

Selector in the example is used by tiptap here https://github.com/ueberdosis/tiptap/blob/62d436569a44fd14966e9a9625f8a981b8a275cd/packages/extension-link/src/link.ts#L117.

@romansp romansp added the bug Something isn't working label May 11, 2023
@capricorn86 capricorn86 self-assigned this May 11, 2023
capricorn86 added a commit that referenced this issue May 12, 2023
…own-for-substring-matching-attribute-selectors-with-whitespaces

#911@minor: Adds support for "i" and "s" modifiers to attribute query…
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