Skip to content

Fix ordered-list numbering in markdown rendering - #437

Merged
Tryanks merged 1 commit into
mainfrom
fix/markdown-ordered-list-start
Sep 15, 2026
Merged

Tryanks merged 1 commit into
mainfrom
fix/markdown-ordered-list-start

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Ordered lists that CommonMark splits (a paragraph or code block between items) have a non-1 start; the renderer ignored it and numbered from the item index, so every fragment rendered as 1..
  • Carry start from rushdown through BlockNode::List into list_item_prefix.

Rebased on #436, which carries the CI and sidebar-test fixes this needs to build.

Test plan

  • cargo test -p tcode-ui (416 passed)
  • cargo clippy -p tcode-ui --all-targets clean
  • New tests: keeps_ordered_list_start, ordered_prefix_honours_list_start

Lists interrupted by a paragraph or code block are separate CommonMark
lists with a non-1 start; the renderer numbered every item from its
index and so restarted at 1. Carry the parsed start through the List
node into the prefix.
@Tryanks
Tryanks force-pushed the fix/markdown-ordered-list-start branch from ba6e419 to 5357142 Compare September 15, 2026 21:16
@Tryanks
Tryanks merged commit f08e603 into main Sep 15, 2026
11 of 12 checks passed
@Tryanks
Tryanks deleted the fix/markdown-ordered-list-start branch September 15, 2026 21:37
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.

1 participant