Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

typeahead: Allow highlighting across multiple words for user names.

N-Shar-mac1741e94d234
diff --git a/web/src/typeahead_helper.js b/web/src/typeahead_helper.js
index 07788e71b9c..065163d2238 100644
--- a/web/src/typeahead_helper.js
+++ b/web/src/typeahead_helper.js
@@ -57,21 +57,12 @@ export function highlight_with_escaping_and_regex(regex, item) {
}
export function make_query_highlighter(query) {
- let i;
query = query.toLowerCase();
const regex = build_highlight_regex(query);
return function (phrase) {
- let result = "";
- const parts = phrase.split(" ");
- for (i = 0; i < parts.length; i += 1) {
- if (i > 0) {
- result += " ";
- }
- result += highlight_with_escaping_and_regex(regex, parts[i]);
- }
- return result;
+ return highlight_with_escaping_and_regex(regex, phrase);
};
}