Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PatrickAfshar opened this issue Feb 19, 2025 · 0 comments
Labels
html lists Relates to Lexical Lists serialization

Comments

@PatrickAfshar
Copy link

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

@etrepum etrepum added lists Relates to Lexical Lists html serialization labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
html lists Relates to Lexical Lists serialization
Projects
None yet
Development

No branches or pull requests

2 participants