From edda967100e075087fef8df507128c014fed520b Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Tue, 20 Aug 2013 12:55:30 -0400 Subject: [PATCH] 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) --- static/js/narrow.js | 2 +- zerver/tests/frontend/node/narrow.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/narrow.js b/static/js/narrow.js index 367254fa41..aa392d8ada 100644 --- a/static/js/narrow.js +++ b/static/js/narrow.js @@ -73,7 +73,7 @@ exports.unparse = function (operators) { // a colon are glued together to form a search term. return elem[1]; } else { - return elem[0] + ':' + encodeOperand(elem[1].toString().toLowerCase()); + return elem[0] + ':' + encodeOperand(elem[1]); } }); return parts.join(' '); diff --git a/zerver/tests/frontend/node/narrow.js b/zerver/tests/frontend/node/narrow.js index 0f543010bb..59cbd432f2 100644 --- a/zerver/tests/frontend/node/narrow.js +++ b/zerver/tests/frontend/node/narrow.js @@ -19,7 +19,7 @@ var stream_data = global.stream_data; assert.deepEqual(narrow.parse(string), operators); - string = 'stream:foo topic:bar yo'; + string = 'stream:Foo topic:Bar yo'; assert.deepEqual(narrow.unparse(operators), string); }());