Skip to content

Commit

Permalink
nit: attempt pathToFileURL
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Mar 6, 2023
1 parent bd7f25d commit 45fac99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/integrations/markdoc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 45fac99

Please sign in to comment.