Skip to content

Commit 2eefb53

Browse files
committed
When relativePath: false, use root absolute paths are for images, solve method as use same router with markdown file then remove beginning # (docsifyjs#877docsifyjs#850)
1 parent b8b221f commit 2eefb53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/render/compiler/image.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ export const imageCompiler = ({ renderer, contentBase, router }) =>
3535
}
3636

3737
if (!isAbsolutePath(href)) {
38-
url = getPath(contentBase, getParentPath(router.getCurrentPath()), href);
38+
url = getPath(contentBase, router.toURL(href, null, router.getCurrentPath()));
3939
}
40-
40+
4141
if (attrs.length > 0) {
4242
return `<img src="${url}" data-origin="${href}" alt="${text}" ${attrs.join(
4343
' '

0 commit comments

Comments
 (0)