Skip to content

Commit a885918

Browse files
authored
Rollup merge of rust-lang#145650 - GuillaumeGomez:fix-js-search-scripts-path, r=fmease
Fix JS search scripts path `rootPath` always end with a `/` so we should not add one. Interestingly enough, it only triggers the bug on a website (like https://doc.rust-lang.org/nightly/std/). Follow-up of rust-lang#144476. Fixes rust-lang#145646. cc ```@notriddle``` r? ```@fmease```
2 parents 6b2615e + e1045c2 commit a885918

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustdoc/html/static/js/search.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5252,7 +5252,7 @@ if (typeof window !== "undefined") {
52525252
},
52535253
loadTreeByHash: hashHex => {
52545254
const script = document.createElement("script");
5255-
script.src = `${ROOT_PATH}/search.index/${hashHex}.js`;
5255+
script.src = `${ROOT_PATH}search.index/${hashHex}.js`;
52565256
script.onerror = e => {
52575257
if (databaseCallbacks) {
52585258
databaseCallbacks.err_rn_(hashHex, e);
@@ -5262,7 +5262,7 @@ if (typeof window !== "undefined") {
52625262
},
52635263
loadDataByNameAndHash: (name, hashHex) => {
52645264
const script = document.createElement("script");
5265-
script.src = `${ROOT_PATH}/search.index/${name}/${hashHex}.js`;
5265+
script.src = `${ROOT_PATH}search.index/${name}/${hashHex}.js`;
52665266
script.onerror = e => {
52675267
if (databaseCallbacks) {
52685268
databaseCallbacks.err_rd_(hashHex, e);

0 commit comments

Comments
 (0)