Open BlackGlory opened 3 years ago
Is this expected behavior?
const lf = '* Section1' + '\n' + '** Section2'
{ "type": "document", "properties": {}, "children": [ { "type": "section", "level": 1, "properties": {}, "children": [ { "type": "headline", "actionable": false, "children": [ { "type": "stars", "level": 1 }, { "type": "text", "value": "Section1" }, { "type": "newline" } ], "level": 1 }, { "type": "section", "level": 2, "properties": {}, "children": [ { "type": "headline", "actionable": false, "children": [ { "type": "stars", "level": 2 }, { "type": "text", "value": "Section2" } ], "level": 2 } ] } ] } ] }
const crlf = '* Section1' + '\r\n' + '** Section2'
{ "type": "document", "properties": {}, "children": [ { "type": "section", "level": 1, "properties": {}, "children": [ { "type": "headline", "actionable": false, "children": [ { "type": "stars", "level": 1 }, { "type": "text", "value": "Section1" }, { "type": "newline" } ], "level": 1 }, { "type": "newline" }, { "type": "section", "level": 2, "properties": {}, "children": [ { "type": "headline", "actionable": false, "children": [ { "type": "stars", "level": 2 }, { "type": "text", "value": "Section2" } ], "level": 2 } ] } ] } ] }
I noticed that when files use CRLF, there are many incorrect results, so maybe all files should be converted to LF before parsing.
Is this expected behavior?
LF
CRLF