Merge pull request #2647 from fduraibi/patch-23

Fix for word highlighting of none Latin characters
pull/2652/merge
Rodrigo Nascimento 9 years ago
commit 9fe4e49c1a
  1. 2
      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<span class="highlight-text">$2</span>$3')
msg = msg.replace(new RegExp("(^|\\b|[\\s\\n\\r\\t.,،'\\\"\\+!?:-])(#{s.escapeRegExp(highlight)})($|\\b|[\\s\\n\\r\\t.,،'\\\"\\+!?:-])(?![^<]*>|[^<>]*<\\/)", 'gmi'), '$1<span class="highlight-text">$2</span>$3')
message.html = msg
return message

Loading…
Cancel
Save