fix: parse crlf frontmatter

This commit is contained in:
lucaronin
2026-04-27 14:31:51 +02:00
parent 324af6b271
commit 9cb0de37a5
5 changed files with 86 additions and 49 deletions

View File

@@ -62,6 +62,10 @@ describe('detectYamlError', () => {
expect(detectYamlError('---\ntitle: My Note\n---\n\n# Title')).toBeNull()
})
it('returns null for valid CRLF frontmatter', () => {
expect(detectYamlError('---\r\ntitle: My Note\r\n---\r\n\r\n# Title')).toBeNull()
})
it('returns error for unclosed frontmatter', () => {
const error = detectYamlError('---\ntitle: My Note\n\n# Title')
expect(error).toContain('Unclosed frontmatter')