When using $generateHtmlFromNodes in Lexical, nested ordered lists are incorrectly numbered. The issue occurs when a nested
is wrapped inside a parent - , 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
- Create an ordered list with a nested list inside one of the items.
- Convert it to HTML using $generateHtmlFromNodes.
- Observe that numbering is incorrect, with a duplicate number appearing in the parent list.
Link to code example:
- Canada
- USA
a. LA
b. TX
c. FL
- Germany
- Italy
The current behavior
- canada
- usa
-
- LA
- TX
- FL
- Germany
- Italy
The expected behavior
- canada
- usa
- LA
- TX
- FL
- Germany
- Italy

When using $generateHtmlFromNodes in Lexical, nested ordered lists are incorrectly numbered. The issue occurs when a nested
is wrapped inside a parent- , causing the numbering to break. Specifically, the parent list incorrectly assigns a duplicate number to an item after a nested list.
- Create an ordered list with a nested list inside one of the items.
- Convert it to HTML using $generateHtmlFromNodes.
- Observe that numbering is incorrect, with a duplicate number appearing in the parent list.
- Canada
- USA
- Germany
- Italy
- canada
- usa
-
- LA
- TX
- FL
- Germany
- Italy
- canada
- usa
- LA
- TX
- FL
- Germany
- Italy

Lexical version: 0.22.0
Steps To Reproduce
Link to code example:
a. LA
b. TX
c. FL
The current behavior
The expected behavior