Skip to content

Commit f0a8d69

Browse files
committed
Fix basePath update when config is function
1 parent 8362ed0 commit f0a8d69

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/helpers/docsify-init.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ async function docsifyInit(options = {}) {
7878
};
7979

8080
const updateBasePath = config => {
81-
config.basePath = new URL(config.basePath, TEST_HOST).href;
81+
if (config.basePath) {
82+
config.basePath = new URL(config.basePath, TEST_HOST).href;
83+
}
8284
};
8385

8486
// Config as function
@@ -128,7 +130,7 @@ async function docsifyInit(options = {}) {
128130
.filter(([url, responseText]) => url && responseText)
129131
.map(([url, responseText]) => [
130132
// Convert relative to absolute URL
131-
new URL(url, settings.config.basePath).href,
133+
new URL(url, settings.config.basePath || TEST_HOST).href,
132134
// Strip indentation from responseText
133135
stripIndent`${responseText}`,
134136
])

0 commit comments

Comments
 (0)