From 9d1913a16e911c2580637fbae7a76d5d918039b5 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 7 Jul 2019 06:29:14 -0400 Subject: [PATCH] Eat backslashes only for common control characters Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/658 --- src/js/codemirror/search.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/codemirror/search.js b/src/js/codemirror/search.js index a52852a13..2a63b7582 100644 --- a/src/js/codemirror/search.js +++ b/src/js/codemirror/search.js @@ -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 _; }); }