Bladeren bron

fix(win32): handle CRLF line endings in markdown frontmatter parsing (#14886)

Luke Parker 1 maand geleden
bovenliggende
commit
659068942e
2 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 1 1
      packages/opencode/src/config/markdown.ts
  2. 1 1
      packages/opencode/test/config/markdown.test.ts

+ 1 - 1
packages/opencode/src/config/markdown.ts

@@ -22,7 +22,7 @@ export namespace ConfigMarkdown {
     if (!match) return content
 
     const frontmatter = match[1]
-    const lines = frontmatter.split("\n")
+    const lines = frontmatter.split(/\r?\n/)
     const result: string[] = []
 
     for (const line of lines) {

+ 1 - 1
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 Requirements
 
 Always structure your responses using clear markdown formatting: