From d3aca511306ed3d4cecf0b9b1ba9a103b0b608e7 Mon Sep 17 00:00:00 2001 From: Android Date: Fri, 11 Feb 2022 12:33:09 +0800 Subject: [PATCH] Fix relative path of readme image --- components/previews/MarkdownPreview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/previews/MarkdownPreview.tsx b/components/previews/MarkdownPreview.tsx index b8b6815..4b4b3d8 100644 --- a/components/previews/MarkdownPreview.tsx +++ b/components/previews/MarkdownPreview.tsx @@ -25,7 +25,7 @@ const MarkdownPreview: FC<{ const { t } = useTranslation() // The parent folder of the markdown file, which is also the relative image folder - const parentPath = path.substring(0, path.lastIndexOf('/')) + const parentPath = standalone ? path.substring(0, path.lastIndexOf('/')) : path // Check if the image is relative path instead of a absolute url const isUrlAbsolute = (url: string | string[]) => url.indexOf('://') > 0 || url.indexOf('//') === 0 // Custom renderer to render images with relative path