Uh oh!
There was an error while loading. Please reload this page.
fix(win32): handle CRLF line endings in markdown frontmatter parsing - #14886
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a Windows-specific bug in markdown frontmatter parsing where CRLF line endings (\r\n) caused field extraction to fail. The fix changes the split logic from a literal string split on \n to a regex split on /\r?\n/ that handles both Unix (LF) and Windows (CRLF) line endings. Additionally, a test assertion that checks multi-line markdown content is updated to normalize CRLF before comparison.
Changes:
- Modified frontmatter parsing to handle CRLF line endings cross-platform
- Updated test assertion to normalize line endings for multi-line content comparison
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/opencode/src/config/markdown.ts | Changed frontmatter line splitting from .split("\n") to .split(/\r?\n/) to handle both Unix and Windows line endings |
| packages/opencode/test/config/markdown.test.ts | Added .replace(/\r\n/g, "\n") normalization to test assertion for multi-line markdown content to handle CRLF |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Summary
\nwhich fails on Windows where files have\r\n— changed to split on/\r?\n/so field extraction works cross-platform.\r\n.Fixes 16 Windows unit test failures. Split out from #14742.