Fix drawer parsing to not take headlines#35
Closed
calmofthestorm wants to merge 3 commits intoPoiScript:masterfrom
Closed
Fix drawer parsing to not take headlines#35calmofthestorm wants to merge 3 commits intoPoiScript:masterfrom
calmofthestorm wants to merge 3 commits intoPoiScript:masterfrom
Conversation
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"`.
Currently, when parsing a drawer for a node of level N, any headlines of level N + 1 will be absorbed into the drawer. This changes drawer parsing to reject headlines. For example: ``` * Hello :PROPERTIES: ** World :END: ``` should be parsed as two nodes. The drawer is ill-formed, and will be parsed as part of the body instead of as a drawer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please review after #34 .
Currently, when parsing a drawer for a node of level N, any headlines of level N + 1 will be absorbed into the drawer. This changes drawer parsing to reject headlines. For example:
should be parsed as two nodes. The drawer is ill-formed, and will be parsed as part of the body instead of as a drawer.
This will fix #24 .