subconsciousnetwork / subtext

Markup for note taking
Apache License 2.0
271 stars 20 forks source link

Block-per-line revisions #47

Closed cdata closed 1 year ago

cdata commented 1 year ago

In the course of resolving #45 and discussing #46, I uncovered that the Rust parser's representation of blocks is not well aligned with the spirit of the spec.

This change updates the block semantics of the Rust parser to align much more closely to the spec. Now, list blocks are broken out into individual items (previously sequential list items would accrue to a single block). Similarly, blanks are broken up by line (where previously they would accrue to a single block).

This revision gave rise to an opportunity to simplify parsing conditions significantly. Most notably: all sigil-specific code paths have been collapsed into one path.

In addition to the above changes, this change introduces two other meaningful updates:

The revisions to the parser that were necessary to implement to_text_content() should set us up to easily revise things in the future if we decide that leading whitespace is significant for list blocks (per details in #31 and #46).

Fixes #45