Skip to content

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

@PatrickAfshar

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions