Skip to content

fix: indent a list nested in a numbered item to the item text in Mark… - #984

Merged
adbar merged 1 commit into
adbar:masterfrom
RavSinghChandan:nested-ordered-list-indent
Oct 21, 2026
Merged

adbar merged 1 commit into
adbar:masterfrom
RavSinghChandan:nested-ordered-list-indent

Conversation

@RavSinghChandan

Copy link
Copy Markdown
Contributor

Nested list items were always indented by 2 spaces per level. That works under a - bullet, but CommonMark needs a nested list to start where the text of its parent item starts: 3 spaces after 1. and 4 after 10. . With 2,

  1. one
    1. inner
  2. two
came out as 1. one\n 1. inner\n2. two, which Markdown renderers show as three sibling items instead of a nested list (checked with markdown-it-py).

_list_marker() now indents a nested item by the width of its parent item's marker, so the output nests as in the HTML. Lists under bullets (- a\n 1. b, test A5-nested-ordered) and plain-text output are unchanged. Added tests for an ordered list in an ordered item, bullets in an ordered item, and a list under a two-digit item.

@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.95%. Comparing base (e2f85c9) to head (2ca9233).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #984   +/-   ##
=======================================
  Coverage   99.95%   99.95%           
=======================================
  Files          21       21           
  Lines        4174     4177    +3     
=======================================
+ Hits         4172     4175    +3     
  Misses          2        2           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adbar
adbar merged commit a794897 into adbar:master Oct 21, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants