From 3cd8ce65141729290d3f6162588c7f6c80265ea6 Mon Sep 17 00:00:00 2001 From: Alistair McKinlay Date: Sun, 10 Jun 2018 09:27:11 +0100 Subject: [PATCH] Fix word boundary in the custom highlights regex not matching unicode Fixes #1939 --- client/js/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/js/options.js b/client/js/options.js index 02b3676a..ad37bdbb 100644 --- a/client/js/options.js +++ b/client/js/options.js @@ -146,7 +146,7 @@ function applySetting(name, value) { }); if (highlightsTokens && highlightsTokens.length) { - module.exports.highlightsRE = new RegExp("\\b(?:" + highlightsTokens.join("|") + ")\\b", "i"); + module.exports.highlightsRE = new RegExp(`(?:^| |\t)(?:${highlightsTokens.join("|")})(?:\t| |$)`, "i"); } else { module.exports.highlightsRE = null; }