-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
Whitespace-only classNames (e.g. class=" ") are currently added with the pattern ".", causing the following error:
Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': '.' is not a valid selector.
Here's the relevant bit of code in match.js:
if (attributeName === 'class') {
const className = attributeValue.trim().replace(/\s+/g, '.')
pattern = `.${className}`
}
I see a few potential fixes:
- Still using the blank class as a selector, just keeping it as
[class=' ']instead of converting to dot version - Not using it as a selector - continuing to next attribute
- Only using as a selector if there are no non-blank attributes to use
Happy to put a fix in if helpful, just not sure which is best
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels