Skip to content

Commit

Permalink
Eat backslashes only for common control characters
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jul 7, 2019
1 parent 2acaf3c commit 9d1913a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/js/codemirror/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,14 @@
);
}

// 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";
return ch;
if (ch === 't') return '\t';
return _;
});
}

Expand Down

0 comments on commit 9d1913a

Please sign in to comment.