W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2020

Re: [csswg-drafts] [css-selectors][css-escape] Cannot select attributes with multiple escaped chars (#4820)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Sun, 01 Mar 2020 18:33:20 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-593129197-1583087598-sysbot+gh@w3.org>
Yes, you are missing something, you should escape the backslash in `WINDOWS\system32`.
And it's fine but unnecessary to escape `:` and `.` in a string.

```js
var li = document.createElement("li");
li.dataset.path = String.raw`c:\WINDOWS\system32\mspaint.exe`;
li.matches(String.raw`li[data-path^="c:\\WINDOWS\\system32\\mspaint.exe"]`); // true
li.matches(String.raw`li[data-path^=c\:\\WINDOWS\\system32\\mspaint\.exe]`); // true
```

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4820#issuecomment-593129197 using your GitHub account
Received on Sunday, 1 March 2020 18:33:21 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:02 UTC