Skip to content

Commit d15d582

Browse files
Fix JS search scripts path
1 parent 22a86f8 commit d15d582

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 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,8 @@ 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+
const sep = ROOT_PATH.endsWith('/') ? '' : '/';
5266+
script.src = `${ROOT_PATH}search.index/${name}/${hashHex}.js`;
52665267
script.onerror = e => {
52675268
if (databaseCallbacks) {
52685269
databaseCallbacks.err_rd_(hashHex, e);

0 commit comments

Comments
 (0)