diff --git a/bin/main.js b/bin/main.js index 14059affde..90ba9887f3 100644 --- a/bin/main.js +++ b/bin/main.js @@ -153,7 +153,7 @@ export async function main(nodeProcess) { async function getData() { if (!input) { - if (files.length <= 2) { + if (files.length === 0) { if (string) { return string; } @@ -161,6 +161,7 @@ export async function main(nodeProcess) { } input = files.pop(); } + return await readFile(input, 'utf8'); } @@ -183,7 +184,9 @@ export async function main(nodeProcess) { throw err; } // must import esm - markedConfig = await import('file:///' + configFile); + const { pathToFileURL } = await import('node:url'); + markedConfig = await import(pathToFileURL(configFile).href); + } if (markedConfig.default) { diff --git a/marked b/marked new file mode 160000 index 0000000000..23b9d0137f --- /dev/null +++ b/marked @@ -0,0 +1 @@ +Subproject commit 23b9d0137fb260ff0033d3c56cdce386201d5fa6