From b27339a9de4af255d311c1032558d4ab29d11019 Mon Sep 17 00:00:00 2001 From: Wes Rollings Date: Thu, 22 Jan 2026 13:54:06 -0700 Subject: [PATCH] fix: handle Windows line endings in YAML frontmatter parsing The regex for extracting YAML frontmatter from markdown files used \n which doesn't match Windows line endings (\r\n). This caused 6 gate tests to fail on Windows systems. Changed regex from /^---\n/ to /^---\r?\n/ to support both Unix and Windows line endings. --- openspec/lib/gates.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openspec/lib/gates.ts b/openspec/lib/gates.ts index 3e44aea..f805091 100644 --- a/openspec/lib/gates.ts +++ b/openspec/lib/gates.ts @@ -23,7 +23,8 @@ import type { async function extractFrontmatter(filePath: string): Promise> { try { const content = await readFile(filePath, 'utf-8'); - const match = content.match(/^---\n([\s\S]*?)\n---/); + // Handle both Unix (\n) and Windows (\r\n) line endings + const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/); if (match) { return parseYaml(match[1]) as Record; }