Commit graph

229 commits

Author SHA1 Message Date
Alex Roper 4fe0958843 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"`.
2020-05-13 20:37:44 -07:00
PoiScript 5e4457e26e release: bump version to 0.8.4 2020-05-10 02:00:22 +08:00
PoiScript 1f53a8c244 fix(title): fix is_commented to recognize any whitespaces (#21) 2020-05-10 01:47:03 +08:00
PoiScript b482dcb2d4 test: add test cases for issue #22 2020-05-10 01:26:59 +08:00
PoiScript ba9c83cc5e fix(parser): use char::is_whitespace (#22) 2020-05-10 01:25:35 +08:00
PoiScript a99702a4da fix(title): expect space after priority (#20) 2020-05-09 16:56:32 +08:00
PoiScript 2128e86b81 refactor: cleanup parse functions 2020-05-09 16:42:49 +08:00
PoiScript d9fb9aadcb release: bump version to 0.8.3 2020-05-06 11:40:07 +08:00
PoiScript d2893664c6 test: add test cases for both #15 and #16 2020-05-06 11:36:40 +08:00
PoiScript d13dcb91c9 fix(title): tags can be separated by \t (#16) 2020-05-06 11:36:06 +08:00
PoiScript bee2723304 fix(title): validate characters of tag line (#16) 2020-05-06 11:35:32 +08:00
Alex Roper 2dfe89f3dc
fix(title): fix is_commented to look for only a single space (#14) 2020-05-06 11:07:32 +08:00
PoiScript 923343a076 fix(validate): allow empty ListItem (#11) 2020-05-06 11:04:50 +08:00
Alex Roper 8fb6e90f57
feat: add Clone derive (#13) 2020-05-06 10:51:10 +08:00
PoiScript 317ca7333d release: bump version to 0.8.2 2020-05-04 10:21:42 +08:00
PoiScript d4698798ff style: remove dbg! macros 2020-05-04 10:20:08 +08:00
PoiScript d77e3316a0 test: add test cases (#10) 2020-05-04 10:20:08 +08:00
PoiScript 37853180bb fix(emphasis): continue if text content is empty (#10) 2020-05-04 10:07:01 +08:00
PoiScript d86597fb25 release: bump version to 0.8.1 2020-04-14 19:02:39 +08:00
PoiScript c6f0c98d87 ci: switch to github actions 2020-04-14 18:12:09 +08:00
PoiScript c2849d05fb refactor(elements): minor refactoring 2020-04-14 17:59:45 +08:00
PoiScript 020548fad9 feat(parse): create combinators module 2020-04-14 17:55:19 +08:00
PoiScript 2ec3f6982a release: bump version to 0.8.0 2020-04-06 16:17:18 +08:00
PoiScript c168c902e8 build: upgrade dependencies 2020-04-06 16:17:18 +08:00
PoiScript 19740440db feat(org): add parse_string and parse_string_custom 2020-04-06 16:17:08 +08:00
Alex Roper 37e27b3461
docs: fix a few misspelled words (#5) 2020-03-14 10:21:20 +08:00
PoiScript 56e6111ae7 release: bump version to 0.7.0 2019-11-06 14:48:55 +08:00
PoiScript 65629b692f fix(validate): table row can have no children 2019-11-06 14:10:18 +08:00
PoiScript 7d064c526e fix(docs): update functions name 2019-11-06 00:31:35 +08:00
PoiScript 9445db822b chore: remove all deprecated functions 2019-11-05 23:58:45 +08:00
PoiScript dc57ab7bdc test: add table parsing and rendering test 2019-11-05 23:58:45 +08:00
PoiScript e3d051145f feat(headline): minor refactors 2019-11-05 23:58:45 +08:00
PoiScript 6483ef745f feat(export): update handler trait methods signature 2019-11-05 23:58:45 +08:00
PoiScript b8265814aa feat(parsers): update table parsing 2019-11-05 23:58:17 +08:00
PoiScript 5d5fc58027 feat: better error message for validation failure 2019-11-05 17:04:03 +08:00
PoiScript e4204729c2 fix: ignore trailing newline in table parsing (#4) 2019-11-05 17:02:20 +08:00
PoiScript 68767337bf release: bump version to 0.6.0 2019-10-30 21:16:53 +08:00
PoiScript dd638d0d4a refactor(export): minor refactor 2019-10-30 21:06:33 +08:00
PoiScript ab377b2cc5 feat: Org::keywords function 2019-10-30 21:05:37 +08:00
PoiScript b446471535 feat(parser): table blank lines 2019-10-30 14:46:20 +08:00
PoiScript ead6ea6289 fix(elements): satisfy the borrow checker 2019-10-30 14:03:47 +08:00
PoiScript b9781c0190 feat(elements): Title::is_commented 2019-10-30 11:59:20 +08:00
PoiScript 1cc22d49ab docs: document pre_blank and post_blank 2019-10-30 11:40:53 +08:00
PoiScript 73c6e9de8f feat(parser): update list parsing 2019-10-30 11:40:53 +08:00
PoiScript ec334c2821 chore: rename several functions 2019-10-28 16:14:00 +08:00
PoiScript 8bb34b5690 fix: fix import path 2019-10-28 13:53:57 +08:00
PoiScript 84cad1854a fix: fix argument type 2019-10-28 13:43:32 +08:00
PoiScript 948b1be2db feat: pre_blank and post_blank 2019-10-28 13:33:18 +08:00
PoiScript 1a0240a747 feat: impl Index & IndexMut trait for Org struct 2019-10-27 22:54:52 +08:00
PoiScript 947c334bf1 docs: document and doc-test of Headline and Document 2019-10-27 22:18:18 +08:00