Skip to content
This repository has been archived by the owner on Jan 22, 2023. It is now read-only.

Commit

Permalink
Escape \ in rule string
Browse files Browse the repository at this point in the history
  • Loading branch information
lauriro committed Dec 30, 2022
1 parent 01b1fdf commit 237c2fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -65,7 +65,7 @@
, tag = sel.slice(from).replace(selectorRe, function(_, op, key, subSel, fn, val, quotation) {
rules.push(
"((v='" +
(subSel || (quotation ? val.slice(1, -1) : val) || "").replace(/'/g, "\\'") +
(subSel || (quotation ? val.slice(1, -1) : val) || "").replace(/[\\']/g, "\\$&") +
"'),(a='" + key + "'),1)"
,
selectorMap[op == ":" ? key : op] ||
Expand Down

0 comments on commit 237c2fb

Please sign in to comment.