From afe3176c8966ce8c2b6a61cd735fe76ad0cb334b Mon Sep 17 00:00:00 2001 From: Fahad Alduraibi Date: Fri, 25 Mar 2016 14:58:58 -0400 Subject: [PATCH] Fix for word highlighting of none Latin characters Updated regex that supports words using other than ASCII characters --- packages/rocketchat-highlight-words/client.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-highlight-words/client.coffee b/packages/rocketchat-highlight-words/client.coffee index e9e2ffb08d4..0e838c2fccd 100644 --- a/packages/rocketchat-highlight-words/client.coffee +++ b/packages/rocketchat-highlight-words/client.coffee @@ -17,7 +17,7 @@ class HighlightWordsClient _.forEach to_highlight, (highlight) -> if not _.isBlank(highlight) - msg = msg.replace(new RegExp("(\\b)(#{s.escapeRegExp(highlight)})(\\b)(?![^<]*>|[^<>]*<\\/)", 'gmi'), '$1$2$3') + msg = msg.replace(new RegExp("(^|\\b|[\\s\\n\\r\\t.,،'\\\"\\+!?:-])(#{s.escapeRegExp(highlight)})($|\\b|[\\s\\n\\r\\t.,،'\\\"\\+!?:-])(?![^<]*>|[^<>]*<\\/)", 'gmi'), '$1$2$3') message.html = msg return message