orgize
orgize copied to clipboard
Fix headline parsing leading to dropped lines.
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