Skip to content

React Native: optional hierarchical ordered-list numbering #1051

Open

Description

@benforsrup

Problem

Nested ordered lists display local counters (1., 2.) at each level. Applications displaying outlines need optional ancestor-qualified markers (1.1., 1.2., 2.1.), with wrapped text aligned after the full marker.

Proposed API

<EnrichedMarkdownText
  markdown={'1. Parent\n   1. Child\n   2. Another child\n2. Next parent\n   1. Child'}
  markdownStyle={{ list: { numbering: 'hierarchical' } }}
/>
  • list.numbering: 'flat' | 'hierarchical', default 'flat'.
  • React Native iOS and Android implementations together.
  • Derive ancestor counters from parsed list structure, reserve marker width, and restore the parent context after nested lists.
  • Keep Markdown parsing and existing default markers unchanged.

Alternatives

Prepending numbers to Markdown text changes the document, complicates streaming/selection, and risks double numbering. A renderer option can keep the source intact.

Validation and open questions

The local 1.1.1 consumer patch was rebuilt and captured on iOS and Android for two-level lists, parent advancement and long wrapped items. Current upstream has newer marker-width/mixed-list fixes; the source-only draft #1053 preserves those, but that port has not yet been built in the upstream example app.

Deeper nesting, mixed ordered/unordered/task lists, non-default starts, RTL, font scaling, live streaming and the upstream default-mode regression matrix still need coverage. The API should be reviewed before marking the draft ready. Web/macOS behavior is outside this initial proposal.

Draft implementation: #1053.

Activity

  1. eszlamczyk commented on Oct 26, 2026

    @eszlamczyk
    Collaborator

    Hi @benforsrup, thanks for the proposal and the draft in #1053! We don't know yet when we'll be able to look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions