summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
authorGirish S <girish.sonawane@gmail.com>2015-10-26 13:00:26 +0530
committerGirish S <girish.sonawane@gmail.com>2015-10-26 13:00:26 +0530
commite9812655f6cb7e9e6c06bc1b2a462efc106f52f7 (patch)
tree47700c7e3a22a19703fd07d69647e849c894fde4 /web/react/utils
parent4cfde35256cecab12d317e0d829769143f4df2d0 (diff)
downloadchat-e9812655f6cb7e9e6c06bc1b2a462efc106f52f7.tar.gz
chat-e9812655f6cb7e9e6c06bc1b2a462efc106f52f7.tar.bz2
chat-e9812655f6cb7e9e6c06bc1b2a462efc106f52f7.zip
made eslint happy
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/text_formatting.jsx5
1 files changed, 2 insertions, 3 deletions
diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx
index 75f6cb714..204c37364 100644
--- a/web/react/utils/text_formatting.jsx
+++ b/web/react/utils/text_formatting.jsx
@@ -243,11 +243,10 @@ function autolinkHashtags(text, tokens) {
function highlightSearchTerm(text, tokens, searchTerm) {
let output = text;
- searchTerm = searchTerm.replace(/\*$/, '');
var newTokens = new Map();
for (const [alias, token] of tokens) {
- if (token.originalText.indexOf(searchTerm) > -1) {
+ if (token.originalText.indexOf(searchTerm.replace(/\*$/, '')) > -1) {
const index = tokens.size + newTokens.size;
const newAlias = `MM_SEARCHTERM${index}`;
@@ -277,7 +276,7 @@ function highlightSearchTerm(text, tokens, searchTerm) {
return prefix + alias;
}
- return output.replace(new RegExp(`()(${searchTerm})`, 'gi'), replaceSearchTermWithToken);
+ return output.replace(new RegExp(`()(${searchTerm})`, 'gi'), replaceSearchTermWithToken);
}
function replaceTokens(text, tokens) {