subconsciousnetwork / subtext

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

Rust subtext parser should parse each list item as a block #45

Closed cdata closed 1 year ago

cdata commented 1 year ago

Currently, the Rust Subtext parser represents all items that appear to be a part of a common list as a single Block: https://github.com/subconsciousnetwork/subtext/blob/3a5dee604eb4593a705aec7cdfc219e8326c1fcb/parsers/rust/subtext/src/block.rs#L12

This is probably incorrect on the face of it (@gordonbrander can confirm) but is also detrimental for users of the streaming parser. The streaming parser emits parsed Subtext block-at-a-time, so a file that is one big list will have to be parsed in its entirety before anything is emitted. It seems most likely that a consumer of the streaming parser would want to take action on list items one-at-a-time so this is wasted time in the best case.