diff --git a/scripts/test-markdown-links.mjs b/scripts/test-markdown-links.mjs index 93c7d894..640744f3 100644 --- a/scripts/test-markdown-links.mjs +++ b/scripts/test-markdown-links.mjs @@ -7,8 +7,11 @@ import { fileURLToPath } from "node:url"; const root = join(dirname(fileURLToPath(import.meta.url)), ".."); -const files = execFileSync("git", ["ls-files", "*.md"], { cwd: root, encoding: "utf8" }) - .split("\n") +const files = execFileSync("git", ["ls-files", "-z", "--", "*.md"], { + cwd: root, + encoding: "utf8", +}) + .split("\0") .filter(Boolean); // Remove fenced code blocks and inline code spans while keeping line numbers.