xoofx / xoofx/markdig

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

Open
#20 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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 BlockParsers to create/modify blocks.

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.