Skip to content

CSS selector not escaped properly #156

@KPblCEHblLLl

Description

@KPblCEHblLLl

(element.className ? '.' + escape(element.classList[0]) : ''));

Here a proper MDN: CSS.escape is required. Otherwise a perfectly valid CSS class w-1/3 will throw an error.
I do not know why the escape is used here and will backwards compatibility allow it to be replaced with CSS.escape, but may I suggest to at least additionally wrap with CSS.escape?
Or create any tool to be able to override the escaping for this particular code line. Otherwise it is a hard blocker to use this library. Because it itself creates an invalid selector and then throws an exception.

Btw, thanks for the library :)
Spent some nice time debugging through it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions