Bug: : Missing Support for Nested Numeric Ordered Lists in @lexical/list
#7033
Description
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:
- First item
1.1. Sub-item
1.2. Sub-item - 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:
- First item
1.1. Sub-item
1.2. Sub-item - 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:
- 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:
- Install the
@lexical/list
package. - Insert an ordered list.
- Nest list items to create a second-level list.
- 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:
- Introduce a new list type (e.g.,
numeric
) that applies hierarchical numbering to ordered lists. - 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?