Skip to content

fix: handle Windows line endings in YAML frontmatter parsing - #2

Merged
SwiggitySwerve merged 1 commit into
masterfrom
fix/windows-line-endings
Jan 22, 2026
Merged

SwiggitySwerve merged 1 commit into
masterfrom
fix/windows-line-endings

Conversation

@SwiggitySwerve

Copy link
Copy Markdown
Owner

Summary

  • Fix regex in openspec/lib/gates.ts to handle both Unix (\n) and Windows (\r\n) line endings
  • Resolves 6 failing gate tests on Windows systems

Changes

Changed frontmatter extraction regex from:

/^---\n([\s\S]*?)\n---/

to:

/^---\r?\n([\s\S]*?)\r?\n---/

Testing

  • All 138 tests pass
  • Verified plugin installation works correctly

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.
@SwiggitySwerve
SwiggitySwerve merged commit 5663b78 into master Jan 22, 2026
1 check failed
@SwiggitySwerve
SwiggitySwerve deleted the fix/windows-line-endings branch January 22, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant