Skip to content

Feature: Wrap nested lists in previous listitem instead of in a new listitem  #2951

@Placeprom

Description

@Placeprom

Lexical version: 0.3.11

Current solution

Currently nested lists are added wrapped inside a new listitem:

<ol>
   <li>one</li>
   <li>
      <ol>
         <li>one.one</li>
         <li>one.two</li>
      </ol>
   </li>
   <li>two</li>
</ol>

This makes things like prefixes for nested list (1.1, 1.2 [...]) way harder to achieve. We can´t easily make use of incrementing css counters and autoincrements won´t work correctly since there is another list item in the first level list. Actually we need to set list-style-type:"none"; on nested lists to get rid of multiple (and incorrect) counters.

Alternative solution

An alternative solution would be to wrap the nested list inside the previous listitem.

<ol>
   <li>one
      <ol>
         <li>one.one</li>
         <li>one.two</li>
      </ol>
   </li>
   <li>two</li>
</ol>

This would allow us to achieve things like prefixes way easier since we can just use css counters which won´t get mixed up by a wrong number of listitems. We can also make use of the autoincrement since there is no wrong number of listitems in the previous list level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement over existing featurelistsRelates to Lexical Lists

    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