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: : Missing Support for Nested Numeric Ordered Lists in @lexical/list #7033

Open
PatrickAfshar opened this issue Jan 9, 2025 · 1 comment

Comments

@PatrickAfshar
Copy link

Support for Nested Numeric Ordered Lists (e.g., 1.1, 1.2) Missing in @lexical/list

Issue Description:

The @lexical/list package currently lacks support for nested numeric ordered lists with hierarchical numbering, such as:

  1. First item
    1.1. Sub-item
    1.2. Sub-item
  2. Second item

Instead, nested ordered lists use basic numbering (1, 2, 3) for all levels, without maintaining a hierarchical structure. This is inconsistent with how ordered lists are typically handled in word processors like Microsoft Word or Google Docs, where nested levels follow a 1 → 1.1 → 1.2 → 2 pattern.

Expected Behavior:

Nested ordered lists should support multi-level numeric formatting, similar to Microsoft Word, with the following structure:

  1. First item
    1.1. Sub-item
    1.2. Sub-item
  2. Second item

Each sub-level should increment correctly within the hierarchy.

Current Behavior:
The current implementation only allows simple ordered lists, where all levels use basic numbering (1, 2, 3). For example:

  1. First item
    A. Second item
    B. Third item

This makes it difficult to represent structured documents with nested lists that require numeric hierarchy.

Steps to Reproduce:

  1. Install the @lexical/list package.
  2. Insert an ordered list.
  3. Nest list items to create a second-level list.
  4. Observe that the numbering does not follow a hierarchical pattern.

Why This Feature is Important:

This feature is essential for users creating structured documents with legal references, documentation, academic papers, or outlines, where numeric hierarchy is critical for readability and organization.

Without this feature, Lexical falls behind other rich-text editors that support nested numeric lists by default.

Proposed Solution:

  1. Introduce a new list type (e.g., numeric) that applies hierarchical numbering to ordered lists.
  2. Alternatively, allow customization of list numbering styles for each level.

Environment:

  • Lexical Version: 0.22.0
  • React Version:18
  • Browser:chrome
  • OS:Windows

Additional Context:
This feature is available in most modern text editors, including Microsoft Word, Google Docs, and even Markdown processors that support ordered lists with hierarchical numbering.

Would you like me to search for their GitHub link to help you post this?

@etrepum
Copy link
Collaborator

etrepum commented Jan 11, 2025

This is more of a CSS issue than anything else, I think you should be able to configure your editor to do this as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants