Merge pull request #2534 from thelounge/mcinkay/unicode-custom-highlight

Fix word boundary in the custom highlights regex not matching unicode
This commit is contained in:
Pavel Djundik 2018-06-10 11:33:37 +03:00 committed by GitHub
commit 011bf80038
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}