PoiScript / orgize

A Rust library for parsing org-mode files.
https://poiscript.github.io/orgize/
MIT License
277 stars 34 forks source link

Fix headline parsing leading to dropped lines. #34

Closed calmofthestorm closed 7 months ago

calmofthestorm commented 4 years ago

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

PoiScript commented 7 months ago

thanks you for contributing, this problem has been fixed in v0.10.