Try to simplify BlockProcessor main loop/Improve API interaction for BlockParsers
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.3k
- Forks
- 510
- Avg merge
- 8d 5h
- Merged PRs (30d)
- 5
Description
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
BlockParsersto create/modify blocks.
Check if we could simplify the code here and the API for block parsers.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/Markdig/Parsers/BlockProcessor.cs around the main loop at line 371, then read TryContinueBlocks and TryOpenBlocks. Compare how the different BlockParsers create or modify blocks, with particular attention to lazy paragraph continuation and the CommonMark block-structure strategy. Done means a simpler loop and block-parser API, but the issue does not define a concrete acceptance test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100