diff options
author | =Corey Hulen <corey@hulen.com> | 2016-03-17 09:51:45 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-03-17 09:51:45 -0700 |
commit | 5273559ca101d8ae4a55104f18081ab011e5068c (patch) | |
tree | f152b638101b224ffc59ed000e384b651915266a /webapp/utils/text_formatting.jsx | |
parent | 074f15f761ff50388b58e35e8354c139c06a807e (diff) | |
parent | 128204b47a9ff89bf2bea97cd21d3b8892151e69 (diff) | |
download | chat-5273559ca101d8ae4a55104f18081ab011e5068c.tar.gz chat-5273559ca101d8ae4a55104f18081ab011e5068c.tar.bz2 chat-5273559ca101d8ae4a55104f18081ab011e5068c.zip |
Fixing merge
Diffstat (limited to 'webapp/utils/text_formatting.jsx')
-rw-r--r-- | webapp/utils/text_formatting.jsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/webapp/utils/text_formatting.jsx b/webapp/utils/text_formatting.jsx index 9833b995c..4c8b5e24c 100644 --- a/webapp/utils/text_formatting.jsx +++ b/webapp/utils/text_formatting.jsx @@ -213,6 +213,11 @@ function highlightCurrentMentions(text, tokens) { } for (const mention of UserStore.getCurrentMentionKeys()) { + // occasionally we get an empty mention which matches a bunch of empty strings + if (!mention) { + continue; + } + output = output.replace(new RegExp(`(^|\\W)(${escapeRegex(mention)})\\b`, 'gi'), replaceCurrentMentionWithToken); } |