summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/src/remark-content-rel-image-error.ts
diff options
context:
space:
mode:
authorGravatar Ben Holmes <hey@bholmes.dev> 2023-01-11 12:51:31 -0500
committerGravatar GitHub <noreply@github.com> 2023-01-11 12:51:31 -0500
commit52209ca2ad72a30854947dcb3a90ab4db0ac0a6f (patch)
tree707b90eee0464eedfa2dbc10d01500c73d6661c7 /packages/markdown/remark/src/remark-content-rel-image-error.ts
parent665a2c2225e42881f5a9550599e8f3fc1deea0b4 (diff)
downloadastro-52209ca2ad72a30854947dcb3a90ab4db0ac0a6f.tar.gz
astro-52209ca2ad72a30854947dcb3a90ab4db0ac0a6f.tar.zst
astro-52209ca2ad72a30854947dcb3a90ab4db0ac0a6f.zip
[Content collections] Remove experimental flag (#5825)
* refactor: remove experimental.cc from core * chore: remove experimental flag from tests * fix: mock contentDir in remark tests * fix: check vfile.path in rel-image-error plugin * fix: move .astro/ excludes to all test/fixtures * fix: include test/**/fixtures in ignore * chore: changeset
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;