From 1d784d46613af14e2c54f3b2b5ce8bb50775e18b Mon Sep 17 00:00:00 2001 From: Alexis Beingessner Date: Sat, 9 Aug 2014 09:38:10 -0400 Subject: [PATCH] rustdoc: use raw search in URL fixes #16385 fixes #16271 --- src/librustdoc/html/static/main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 2ce9c53d3e83..7b5d1b7be2f6 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -368,7 +368,8 @@ } function getQuery() { - var matches, type, query = $('.search-input').val(); + var matches, type, query, raw = $('.search-input').val(); + query = raw; matches = query.match(/^(fn|mod|struct|enum|trait|t(ype)?d(ef)?)\s*:\s*/i); if (matches) { @@ -379,6 +380,7 @@ } return { + raw: raw, query: query, type: type, id: query + type, @@ -534,10 +536,10 @@ if (browserSupportsHistoryApi()) { if (!history.state && !params.search) { history.pushState(query, "", "?search=" + - encodeURIComponent(query.query)); + encodeURIComponent(query.raw)); } else { history.replaceState(query, "", "?search=" + - encodeURIComponent(query.query)); + encodeURIComponent(query.raw)); } }