CssSelectorGenerator escapes the selector string
See original GitHub issueCssSelectorGenerator escapes the selector string.
eg.
3[src='https\3A \/\/site\.com\/folder\/file\.js']
instead of
3[src='https://site.com/folder/file.js']
Is it possible to get the raw (unescaped) selector?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
CSS.escape() - Web APIs - MDN Web Docs
The CSS.escape() static method returns a string containing the escaped string passed as parameter, mostly for use as part of a CSS selector....
Read more >CSS escapes
CSS escapes. Wondering how to escape any character in CSS? Learn how, or just use this tool ☺.
Read more >Use CSS.escape() to escape QuerySelectorAll() - Rick Strahl
To fix this is simple enough: You can use the CSS.escape() function to escape a literal string and encodes any Selector specific characters....
Read more >Escaping your CSS selectors in the easiest way possible
To prevent errors when selecting these elements they need to be properly escaped to work with any character. At first, I had the...
Read more >Escapes a string for use within a CSS selector as an identifier
// Use this to escape CSS identifiers that may contain reserved characters. // For example, in JQuery, to select the element whose identifier...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see. So the escaping itself is not a problem. It’s the way the colon character is escaped.
I have checked the code. There is special sequence used for colon. I think it’s for compatibility with old browsers. But I’m not sure, I wrote that part very long ago.
I’ll investigate. But I think I will replace the whole escaping logic with
CSS.escape
.The old versions used escaping mechanism that was created to work with old versions of IE. The new version
v3.4.3
usesCSS.escape()
instead. So there should be no longer special escape sequence used for colon.