PLT-4791 Fix hashtag highlight in search results. (#4977)

Этот коммит содержится в:
George Goldberg
2017-01-06 13:54:31 +00:00
коммит произвёл Joram Wilander
родитель c81efa0b4e
Коммит c3f60d7ced

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

@@ -452,6 +452,11 @@ export function highlightSearchTerms(text, tokens, searchPatterns) {
output = output.replace(alias, newAlias);
}
// The pattern regexes are global, so calling pattern.test() above alters their
// state. Reset lastIndex to 0 between calls to test() to ensure it returns the
// same result every time it is called with the same value of token.originalText.
pattern.lastIndex = 0;
}
// the new tokens are stashed in a separate map since we can't add objects to a map during iteration