-
Notifications
You must be signed in to change notification settings - Fork 756
Description
Hello! As someone who isn't part of the WG I wasn't sure where to report the issue so this looked like a reasonable place to do so.
I recently had occasion to want to select an HTML element with an attribute that has a Windows-formatted file path as its main content (i.e. backslash directory separators and a colon separating drive letter and the rest of the path). I asked on Stack Overflow if it was possible, as I was using JavaScript to querySelector it and all my attempts to escape the backslashes and colon, either using CSS.escape or manually, have failed beyond the first escaped char. Microsoft Visual Studio Code, when on Windows, is what formats paths Windows-style, while on macOS and *nix paths separate with / and targeting seems okay. Sample element and failed selector (actual HTML from VSCode in the Stack Overflow):
<li data-path="c:\WINDOWS\system32\mspaint.exe">mspaint.exe</li>li[data-path="c\:\\WINDOW\\system32\\mspaint\.exe"]Is there something I'm missing regarding how to escape the attribute, or is it a fruitless endeavor to try to target an attribute that has a Windows-style path in it?