Skip to content

Commit

Permalink
rustdoc: use raw search in URL
Browse files Browse the repository at this point in the history
fixes #16385
fixes #16271
  • Loading branch information
Gankra committed Aug 9, 2014
1 parent 0f5ce0f commit 1d784d4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/librustdoc/html/static/main.js
Expand Up @@ -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) {
Expand All @@ -379,6 +380,7 @@
}

return {
raw: raw,
query: query,
type: type,
id: query + type,
Expand Down Expand Up @@ -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));
}
}

Expand Down

5 comments on commit 1d784d4

@bors
Copy link
Contributor

@bors bors commented on 1d784d4 Aug 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from cmr
at Gankra@1d784d4

@bors
Copy link
Contributor

@bors bors commented on 1d784d4 Aug 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging Gankro/rust/doc-search = 1d784d4 into auto

@bors
Copy link
Contributor

@bors bors commented on 1d784d4 Aug 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gankro/rust/doc-search = 1d784d4 merged ok, testing candidate = be6c7cf

@bors
Copy link
Contributor

@bors bors commented on 1d784d4 Aug 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = be6c7cf

Please sign in to comment.