Skip to content

Commit 6590689

Browse files
authored
fix(win32): handle CRLF line endings in markdown frontmatter parsing (anomalyco#14886)
1 parent 3201a7d commit 6590689

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/opencode/src/config/markdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export namespace ConfigMarkdown {
2222
if (!match) return content
2323

2424
const frontmatter = match[1]
25-
const lines = frontmatter.split("\n")
25+
const lines = frontmatter.split(/\r?\n/)
2626
const result: string[] = []
2727

2828
for (const line of lines) {

packages/opencode/test/config/markdown.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ describe("ConfigMarkdown: frontmatter parsing w/ Markdown header", async () => {
197197
test("should parse and match", () => {
198198
expect(result).toBeDefined()
199199
expect(result.data).toEqual({})
200-
expect(result.content.trim()).toBe(`# Response Formatting Requirements
200+
expect(result.content.trim().replace(/\r\n/g, "\n")).toBe(`# Response Formatting Requirements
201201
202202
Always structure your responses using clear markdown formatting:
203203

0 commit comments

Comments
 (0)