mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-22 11:25:15 +00:00
fix(win32): handle CRLF line endings in markdown frontmatter parsing (#14886)
This commit is contained in:
parent
3201a7d34b
commit
659068942e
2 changed files with 2 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue