xoofx / xoofx/markdig

Nested lists of roman numerals that differ in casing fail to parse properly

Open
#884 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
C#
Stars
5.3k
Forks
510
Avg merge
8d 5h
Merged PRs (30d)
5

Description

If I try to parse this:

1. **Introduction to Legal Principles**
   1) Historical Context
   2) Core Doctrines
      i. Doctrine of Precedent
      ii. Doctrine of Equity
   3) Sources of Law
2. **Civil Procedure**
   A) Pleadings and Motions
      a. The Complaint
      b. The Answer
      c. Pre-trial Motions
   B) Discovery Process
   C) Trial Proceedings

I get the proper AST:

Image

However, if I change the list before the roman numerals in lowercase to a list with roman numbers in uppercase like this:

1. **Introduction to Legal Principles**
   I) Historical Context
   II) Core Doctrines
      i. Doctrine of Precedent
      ii. Doctrine of Equity
   III) Sources of Law
2. **Civil Procedure**
   A) Pleadings and Motions
      a. The Complaint
      b. The Answer
      c. Pre-trial Motions
   B) Discovery Process
   C) Trial Proceedings

the AST generated is wrong, as it didn't create a third level for the list with lowercase roman numerals:

Image

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

Reproduce both Markdown snippets and inspect the generated AST, focusing on nested ordered-list parsing and differing roman-numeral casing. Done means the uppercase outer roman-numeral lists still produce a distinct third-level list for lowercase roman numerals, matching the first example’s structure; add or run a regression test if the repository provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.