Skip to content

Bug: Bug Report: Incorrect Numbering in Nested Lists using $generateHtmlFromNodes #7207

Closed

Description

@PatrickAfshar

When using $generateHtmlFromNodes in Lexical, nested ordered lists are incorrectly numbered. The issue occurs when a nested

    is wrapped inside a parent
  1. , causing the numbering to break. Specifically, the parent list incorrectly assigns a duplicate number to an item after a nested list.

    Lexical version: 0.22.0

    Steps To Reproduce

    1. Create an ordered list with a nested list inside one of the items.
    2. Convert it to HTML using $generateHtmlFromNodes.
    3. Observe that numbering is incorrect, with a duplicate number appearing in the parent list.

    Link to code example:

    1. Canada
    2. USA
      a. LA
      b. TX
      c. FL
    3. Germany
    4. Italy

    The current behavior

    1. canada
    2. usa
      1. LA
      2. TX
      3. FL
    3. Germany
    4. Italy

    The expected behavior

    1. canada
    2. usa
      1. LA
      2. TX
      3. FL
    3. Germany
    4. Italy

    Image

Activity

  1. added
    lists
    on Feb 19, 2025
  2. added a commit that references this issue on Apr 8, 2026
    f8cdc50
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

    htmllistsserialization

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions