Skip to content

Commit

Permalink
Minor code review re. uBlockOrigin/uBlock-issues#658
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jul 11, 2019
1 parent c499ce8 commit 9ef06da
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/js/codemirror/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}

Expand Down

0 comments on commit 9ef06da

Please sign in to comment.