block / block/buzz

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

Open
#5,817 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

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:

```tsx
ol: ({ children }) => (

    {children}

),
```

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:

```tsx
li: ({ children }) =>

  • {children}
  • ,
    ```

    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

    ```tsx
    li: ({ children, ...props }) => (

  • {children}

  • ),
    ol: ({ children, ...props }) => (
      {children}

    ),
    ```

    ### 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.

    Contributor guide

    Open the contributing guide

    Assessment

    This issue has not been assessed yet.

    Get new issues in your inbox

    A short digest of beginner-friendly GitHub issues.