]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #81379 - GuillaumeGomez:improve-urls, r=Nemo157
authorYuki Okushi <huyuumi.dev@gmail.com>
Thu, 28 Jan 2021 06:09:12 +0000 (15:09 +0900)
committerGitHub <noreply@github.com>
Thu, 28 Jan 2021 06:09:12 +0000 (15:09 +0900)
commit0b1870e7b98f6319a38750c41738c3ad35f01a27
tree4909c062d518d4ba164826e62a7d084b4f53aea2
parentbb6d1d308658cbec85f4379b5f9678e4c273b0bd
parent09518db73e84112922af76f161b803eb90ceb445
Rollup merge of #81379 - GuillaumeGomez:improve-urls, r=Nemo157

Improve URLs handling

Fixes #81330.

Explanations: before this PR, when emptying the search input, we still had `?search=` in the URL, which wasn't very nice. Now, if the search is empty, we drop the `?search=` part.

Also, I realized while working on this PR that when we clicked on a menu link when we were on the search results, the search parameters would look like: `?search=#the-anchor`, which was super weird. Now, it looks like this: `?search=the-search#the-anchor`.

Also, I didn't use the `Url` very nice API because it's not available in any IE version (sadness...).

cc `````@lzutao`````
r? `````@Nemo157`````
src/librustdoc/html/static/main.js