From 45fac9922d099f33ff97176895efc9b1941dd03c Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Mon, 6 Mar 2023 09:51:52 -0500 Subject: [PATCH] nit: attempt pathToFileURL --- packages/integrations/markdoc/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/integrations/markdoc/src/index.ts b/packages/integrations/markdoc/src/index.ts index 8e70187de..ca92e83c9 100644 --- a/packages/integrations/markdoc/src/index.ts +++ b/packages/integrations/markdoc/src/index.ts @@ -3,7 +3,7 @@ import { InlineConfig } from 'vite'; import type { Config } from '@markdoc/markdoc'; import Markdoc from '@markdoc/markdoc'; import { prependForwardSlash, getAstroConfigPath, MarkdocError, parseFrontmatter } from './utils.js'; -import { fileURLToPath } from 'node:url'; +import { fileURLToPath, pathToFileURL } from 'node:url'; import fs from 'node:fs'; export default function markdoc(markdocConfig: Config = {}): AstroIntegration { @@ -39,7 +39,7 @@ export default function markdoc(markdocConfig: Config = {}): AstroIntegration { validateRenderProperties(markdocConfig, config); const body = - getEntryInfo({ fileUrl: new URL(prependForwardSlash(id), 'file://'), contents: code }).body; + getEntryInfo({ fileUrl: pathToFileURL(id), contents: code }).body; const ast = Markdoc.parse(body); const content = Markdoc.transform(ast, markdocConfig);