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

Consider the following tree:

```html
<ul>
<li>first</li>
<li>second</li>
</ul>
```

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

```html
<ul>
<li>first</li>
<ul><li>second</li></ul>
</ul>
```

The resulting tree inserts a `<ul>` inside another `<ul>`, conflicting with [HTML](https://html.spec.whatwg.org/multipage/grouping-content.html#the-ul-element):

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

I guess we have two options:

* Change the indentation behavior: I don't think we want to change the behavior that has been there for decades, though.
* Change HTML. This was [once rejected](https://www.w3.org/Bugs/Public/show_bug.cgi?id=12609) but IMO is the way to go for web compatibility.

Pinging @annevk for the HTML part.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/256

Received on Tuesday, 19 May 2020 21:33:24 UTC