Fix relative path of readme image

This commit is contained in:
Android
2022-02-11 12:33:09 +08:00
committed by GitHub
parent 319af6ed77
commit d3aca51130
+1 -1
View File
@@ -25,7 +25,7 @@ const MarkdownPreview: FC<{
const { t } = useTranslation() const { t } = useTranslation()
// The parent folder of the markdown file, which is also the relative image folder // 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 // Check if the image is relative path instead of a absolute url
const isUrlAbsolute = (url: string | string[]) => url.indexOf('://') > 0 || url.indexOf('//') === 0 const isUrlAbsolute = (url: string | string[]) => url.indexOf('://') > 0 || url.indexOf('//') === 0
// Custom renderer to render images with relative path // Custom renderer to render images with relative path