Leave casing alone in search suggestions.

The function narrow.unparse() is used in a bunch of places in
the search suggestion code, and now it no longer lower cases
operands.  This change contributes to fixing trac #1659.

(imported from commit 6b44b8a818482b5c8b4f9a45bc7d3a9d21e04eba)
This commit is contained in:
Steve Howell
2013-08-20 12:55:30 -04:00
parent 890a4f0ac0
commit edda967100
2 changed files with 2 additions and 2 deletions

View File

@@ -73,7 +73,7 @@ exports.unparse = function (operators) {
// a colon are glued together to form a search term. // a colon are glued together to form a search term.
return elem[1]; return elem[1];
} else { } else {
return elem[0] + ':' + encodeOperand(elem[1].toString().toLowerCase()); return elem[0] + ':' + encodeOperand(elem[1]);
} }
}); });
return parts.join(' '); return parts.join(' ');

View File

@@ -19,7 +19,7 @@ var stream_data = global.stream_data;
assert.deepEqual(narrow.parse(string), operators); assert.deepEqual(narrow.parse(string), operators);
string = 'stream:foo topic:bar yo'; string = 'stream:Foo topic:Bar yo';
assert.deepEqual(narrow.unparse(operators), string); assert.deepEqual(narrow.unparse(operators), string);
}()); }());