Skip to content

Commit 45fac99

Browse files
committed
nit: attempt pathToFileURL
1 parent bd7f25d commit 45fac99

File tree

1 file changed

+2
-2
lines changed
  • packages/integrations/markdoc/src

1 file changed

+2
-2
lines changed

packages/integrations/markdoc/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { InlineConfig } from 'vite';
33
import type { Config } from '@markdoc/markdoc';
44
import Markdoc from '@markdoc/markdoc';
55
import { prependForwardSlash, getAstroConfigPath, MarkdocError, parseFrontmatter } from './utils.js';
6-
import { fileURLToPath } from 'node:url';
6+
import { fileURLToPath, pathToFileURL } from 'node:url';
77
import fs from 'node:fs';
88

99
export default function markdoc(markdocConfig: Config = {}): AstroIntegration {
@@ -39,7 +39,7 @@ export default function markdoc(markdocConfig: Config = {}): AstroIntegration {
3939

4040
validateRenderProperties(markdocConfig, config);
4141
const body =
42-
getEntryInfo({ fileUrl: new URL(prependForwardSlash(id), 'file://'), contents: code }).body;
42+
getEntryInfo({ fileUrl: pathToFileURL(id), contents: code }).body;
4343
const ast = Markdoc.parse(body);
4444
const content = Markdoc.transform(ast, markdocConfig);
4545

0 commit comments

Comments
 (0)