Try to simplify BlockProcessor main loop/Improve API interaction for BlockParsers #26

Open
opened 2026-01-29 14:21:34 +00:00 by claunia · 0 comments
Owner

Originally created by @xoofx on GitHub (Jun 22, 2016).

While the top level main loop for parsing blocks in BlockProcessor is quite simple, the underlying methods TryContinueBlocks and TryOpenBlocks are not simple.

  • This is partly due to the complexity of lazy continuation for Paragraph (see Parsing strategy for blocks in the CommonMark specs).
  • This is also partly due to the different methods used by the different BlockParsers to create/modify blocks.

Check if we could simplify the code here and the API for block parsers.

Originally created by @xoofx on GitHub (Jun 22, 2016). While the top level main loop for parsing blocks in [BlockProcessor](https://github.com/lunet-io/markdig/blob/master/src/Markdig/Parsers/BlockProcessor.cs#L371) is quite simple, the underlying methods `TryContinueBlocks` and `TryOpenBlocks` are not simple. - This is partly due to the complexity of lazy continuation for Paragraph (see [Parsing strategy for blocks](http://spec.commonmark.org/0.25/#phase-1-block-structure) in the CommonMark specs). - This is also partly due to the different methods used by the different `BlockParsers` to create/modify blocks. Check if we could simplify the code here and the API for block parsers.
claunia added the enhancement label 2026-01-29 14:21:34 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#26