mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
Eat backslashes only for common control characters
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/658
This commit is contained in:
parent
2acaf3c433
commit
9d1913a16e
@ -160,11 +160,14 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://github.com/uBlockOrigin/uBlock-issues/issues/658
|
||||||
|
// Modified to backslash-escape ONLY widely-used control characters.
|
||||||
function parseString(string) {
|
function parseString(string) {
|
||||||
return string.replace(/\\(.)/g, function(_, ch) {
|
return string.replace(/\\(.)/g, function(_, ch) {
|
||||||
if (ch === "n") return "\n";
|
if (ch === "n") return "\n";
|
||||||
if (ch === "r") return "\r";
|
if (ch === "r") return "\r";
|
||||||
return ch;
|
if (ch === 't') return '\t';
|
||||||
|
return _;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user