-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Native support for indents #8751
Comments
The There is a proposal for improving editing behaviour although no browsers seem to have indicated an intent to take on the proposal yet. Though with such an API you could just generate |
The problem is that the the HTML spec itself doesn't provide a canonical way to represent list items that are indented multiple levels. So even if you were to generate ul nesting yourself, you couldn't do it in a way that would be semantically correct and function in sane way in modern browsers. |
@GermanJablo, I've wanted this for a long time, because:
I think of it like YAML – specifically, HTML currently supports:
Adding what this issue proposes would also provide the undermentioned: Heading:
Content
Heading:
Content
Heading:
Content
Heading:
Content ExampleThis matters when you have a situation like: Heading:
Content
- Heading:
Content
- Heading:
Content
- Content
- Content ...because it can be replaced with: Heading:
Content
Heading:
Content
Heading:
Content
- Content
- Content ...ensuring that headings remain separate from lists that are unrelated. We've always had this functionality available to us in I've seen Would you propose that this be implemented with an |
I would like to propose that HTML natively supports indents. Although I'm thinking that it could be used in tags like headings or paragraphs, an important point of the suggestion is that they could be used in
li
tags without requiringul
orol
wrapping.This would simplify browsers' implementation of the execCommand API, as well as text editors.
But there are other reasons:
Nested lists are problematic. The execCommand API outputs incorrect HTML when indenting.[1]
Fixing that would not be possible even by changing the API, at least satisfactorily, since it would make it so that if one wanted to indent a
li
two or more times against its parent, the prefixes for nested lists (1.1, 1.2 [...] ) would be incorrect.[2]The concept of nesting may make sense when considering that each nesting always increases a single level of depth, but what happens in real life is that an item can be 2 or more levels deep compared to the previous item; in which case it makes more sense to use a flat model.
Related discussions:
[1] #5567
[2] facebook/lexical#2951
The text was updated successfully, but these errors were encountered: