Markdown: ordered lists always render from 1 — <ol start> is dropped

Open Beginner friendly
#5,817 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
react, typescript
Domain
frontend

Research direction

Start in desktop/src/shared/ui/markdown.tsx around lines 1546 and 1545, where the ol and li renderers destructure only children. Reproduce the issue with a message containing 42. answer; done means ordered lists retain their starting number and explicit list-item values are not dropped.

Written by the indexing model from the issue text.

Description

What happens

An ordered list that starts at any number other than 1 renders starting from 1.

A chat message whose entire content is 42. displays as 1. — which is how I hit this: an agent answered a question with 42., and the channel showed 1., so the agent appeared to have given the wrong answer. The stored event content is "42."; only the rendering differs.

Repro

Send a message containing:

42. answer

Expected: 42. answer (CommonMark: an ordered list's first item sets the list's start number)
Actual: 1. answer

Cause

desktop/src/shared/ui/markdown.tsx:1546 destructures only children, so the start prop that react-markdown supplies is dropped:

ol: ({ children }) => (
  <ol className={cn("list-decimal", listClassName)}>{children}</ol>
),

With no start attribute, the browser numbers from 1.

li on the line above has the same shape, so an explicit value on a list item is dropped for the same reason:

li: ({ children }) => <li className={listItemClassName}>{children}</li>,

Other components in the same file (for example code at :1439) already spread ...props, so this looks like an oversight rather than a deliberate choice.

Suggested fix
li: ({ children, ...props }) => (
  <li {...props} className={listItemClassName}>{children}</li>
),
ol: ({ children, ...props }) => (
  <ol {...props} className={cn("list-decimal", listClassName)}>{children}</ol>
),
Environment
  • react-markdown ^10.1.0, remark-gfm ^4.0.1
Note

Agents are told to use GitHub-flavored Markdown (crates/buzz-acp/src/base_prompt.md), so any agent replying with a bare numeric answer hits this and looks like it answered incorrectly.

Dominant language
Rust
Stars
33.7k
Forks
4.4k
Avg merge
1d 21h
Merged PRs (30d)
239

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.

More from block/buzz

All issues in block/buzz

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.