Skip to content

Commit 738defe

Browse files
committed
fix(parser): provide default cwd to prevent exception outside node environment
1 parent 04b2a37 commit 738defe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/parser/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const createMarkdownParser = async (inlineOptions: MDCParseOptions = {})
104104
const { content, data: frontmatter } = await parseFrontMatter(md)
105105

106106
// Start processing stream
107-
const processedFile = await processor.process({ ...fileOptions, value: content, data: frontmatter })
107+
const processedFile = await processor.process({ cwd: typeof process.cwd === 'function' ? process.cwd() : '/tmp', ...fileOptions, value: content, data: frontmatter })
108108

109109
const result = processedFile.result as { body: MDCRoot, excerpt: MDCRoot | undefined }
110110

0 commit comments

Comments
 (0)