Merge pull request #2424 from hmhealey/escape

Changed mention parser to ignore empty string mentions
Этот коммит содержится в:
Harrison Healey
2016-03-17 10:33:28 -04:00
родитель 927c2dbfec f8ac97fb22
Коммит d42459729c

Просмотреть файл

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