Changed mention parser to ignore empty string mentions

This commit is contained in:
Harrison Healey
2016-03-14 11:23:39 -04:00
parent 927c2dbfec
commit f8ac97fb22

View File

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