We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5141e6 commit 0fcb7daCopy full SHA for 0fcb7da
src/librustdoc/html/static/main.js
@@ -112,9 +112,11 @@ function defocusSearchBar() {
112
}
113
114
function getPageId() {
115
- var id = document.location.href.split("#")[1];
116
- if (id) {
117
- return id.split("?")[0].split("&")[0];
+ if (window.location.hash) {
+ var tmp = window.location.hash.replace(/^#/, "");
+ if (tmp.length > 0) {
118
+ return tmp;
119
+ }
120
121
return null;
122
@@ -2688,8 +2690,8 @@ function defocusSearchBar() {
2688
2690
2689
2691
autoCollapse(pageId, getCurrentValue("rustdoc-collapse") === "true");
2692
- if (window.location.hash && window.location.hash.length > 0) {
- expandSection(window.location.hash.replace(/^#/, ""));
2693
+ if (pageId !== null) {
2694
+ expandSection(pageId);
2695
2696
2697
if (main) {
0 commit comments