search_suggestion: Fix highlighting for multi-word streams.

I deleted a test case that involved a highlighted stream, but
the query was empty. This produces kind of a weird result with
typeahead_helper.highlight_with_escaping, but this function already
has coverage in node_tests/typeahead_helper.js, so the check here
was essentially redundant anyway. Specifically, the highlighter
wraps every character individually with <strong>, and looks really
messy in html.
This commit is contained in:
Cory Lynch
2017-06-23 21:36:04 -04:00
committed by Tim Abbott
parent 76e4350d4d
commit 1dba70ca0d
2 changed files with 1 additions and 2 deletions

View File

@@ -467,7 +467,6 @@ init();
assert.equal(describe('is:alerted'), 'Alerted messages');
assert.equal(describe('is:unread'), 'Unread messages');
assert.equal(describe('sender:bob@zulip.com'), 'Sent by me');
assert.equal(describe('stream:devel'), 'Stream <strong>devel</strong>');
}());
(function test_sent_by_me_suggestions() {

View File

@@ -97,7 +97,7 @@ function get_stream_suggestions(last, operators) {
var objs = _.map(streams, function (stream) {
var prefix = 'stream';
var highlighted_stream = typeahead_helper.highlight_query_in_phrase(query, stream);
var highlighted_stream = typeahead_helper.highlight_with_escaping(query, stream);
var description = prefix + ' ' + highlighted_stream;
var term = {
operator: 'stream',