summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/src/remark-content-rel-image-error.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/markdown/remark/src/remark-content-rel-image-error.ts')
-rw-r--r--packages/markdown/remark/src/remark-content-rel-image-error.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/packages/markdown/remark/src/remark-content-rel-image-error.ts b/packages/markdown/remark/src/remark-content-rel-image-error.ts
index 1a0870c22..3e3664b20 100644
--- a/packages/markdown/remark/src/remark-content-rel-image-error.ts
+++ b/packages/markdown/remark/src/remark-content-rel-image-error.ts
@@ -10,6 +10,8 @@ import type { VFile } from 'vfile';
export default function toRemarkContentRelImageError({ contentDir }: { contentDir: URL }) {
return function remarkContentRelImageError() {
return (tree: any, vfile: VFile) => {
+ if (typeof vfile?.path !== 'string') return;
+
const isContentFile = pathToFileURL(vfile.path).href.startsWith(contentDir.href);
if (!isContentFile) return;