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

execCommand("indent") conflicts with the content model of <ul>/<ol> #256

Open
saschanaz opened this issue May 19, 2020 · 3 comments
Open

Comments

@saschanaz
Copy link
Member

saschanaz commented May 19, 2020

Consider the following tree:

<ul>
<li>first</li>
<li>second</li>
</ul>

Here, execCommand("indent") on the second list item generates the following tree:

<ul>
<li>first</li>
<ul><li>second</li></ul>
</ul>

The resulting tree inserts a <ul> inside another <ul>, conflicting with HTML:

Content model:
Zero or more li and script-supporting elements.

I guess we have two options:

Pinging @annevk for the HTML part.

@annevk
Copy link
Member

annevk commented May 20, 2020

Well, we could also do nothing or add indentCorrectly or some such.

Having said that, I recommend opening an issue against the HTML Standard to see what people think.

@rniwa
Copy link
Contributor

rniwa commented Aug 10, 2020

We definitely can't change this behavior now. A lot of content depends on this behavior.

  • Change HTML. This was once rejected but IMO is the way to go for web compatibility.

I support changing the HTML spec to allow this construct although it's not really a show stopper given all browsers interoperate anyway.

@masayuki-nakano
Copy link
Collaborator

I agree with @rniwa -san. <li> containing only sub list element may also have a bullet, and I don't think this style is better because word processors do not use this style.

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

No branches or pull requests

5 participants