orgize icon indicating copy to clipboard operation
orgize copied to clipboard

Fix headline parsing leading to dropped lines.

Open calmofthestorm opened this issue 4 years ago • 0 comments

Currently, headline parsing breaks the file into lines before parsing headlines, stripping terminal \n or \r\n. This prevents parse_headline_level from differentiating between end of line and end of file.

This can lead to an edge case where a line is considered a headline for the purposes of stopping parsing the body of the previous, yet not a headline itself. This leads to parsing stopping there.

If the file is immediately written, this results in truncating it.

One example of this is "* \n*\r\n* \n", which will be parsed identically to "* \n".

This should fix #26

calmofthestorm avatar May 14 '20 03:05 calmofthestorm