1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-14 23:12:28 +02:00
This commit is contained in:
Raymond Hill 2019-07-11 09:50:12 -04:00
parent c499ce82a9
commit 9ef06da310
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -163,12 +163,12 @@
// https://github.com/uBlockOrigin/uBlock-issues/issues/658
// Modified to backslash-escape ONLY widely-used control characters.
function parseString(string) {
return string.replace(/\\(.)/g, function(_, ch) {
if (ch === "n") return "\n";
if (ch === "r") return "\r";
if (ch === 't') return '\t';
if (ch === '\\') return '\\';
return _;
return string.replace(/\\[nrt\\]/g, function(match) {
if (match === "\\n") return "\n";
if (match === "\\r") return "\r";
if (match === '\\t') return '\t';
if (match === '\\\\') return '\\';
return match;
});
}