The open source coding agent.
TypeScript
fix(win32): handle CRLF line endings in markdown frontmatter parsing (#14886)
Luke Parker659068942eda
diff --git a/packages/opencode/src/config/markdown.ts b/packages/opencode/src/config/markdown.tsindex 5b4ccf04771..3c9709b5b3b 100644--- a/packages/opencode/src/config/markdown.ts+++ b/packages/opencode/src/config/markdown.ts@@ -22,7 +22,7 @@ export namespace ConfigMarkdown {if (!match) return contentconst frontmatter = match[1]- const lines = frontmatter.split("\n")+ const lines = frontmatter.split(/\r?\n/)const result: string[] = []for (const line of lines) {diff --git a/packages/opencode/test/config/markdown.test.ts b/packages/opencode/test/config/markdown.test.tsindex c6133317e2c..865af210773 100644--- a/packages/opencode/test/config/markdown.test.ts+++ b/packages/opencode/test/config/markdown.test.ts@@ -197,7 +197,7 @@ describe("ConfigMarkdown: frontmatter parsing w/ Markdown header", async () => {test("should parse and match", () => {expect(result).toBeDefined()expect(result.data).toEqual({})- expect(result.content.trim()).toBe(`# Response Formatting Requirements+ expect(result.content.trim().replace(/\r\n/g, "\n")).toBe(`# Response Formatting RequirementsAlways structure your responses using clear markdown formatting: