Nested editing hosts do not need to be wrapped in insertParagraph
@zcorpan is already working on this.
Since Oct 20, 2025.
- Dominant language
- HTML
- Stars
- 202
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
When performing the action for insertParagraph, step 11 asks to check if the container is not editable:
This is not how it currently works in both Chrome and Firefox for the following case:
<div contenteditable>foo <div contenteditable>bar</div></div>
If insertParagraph is run while a selection exists inside the inner editing host, a new container is created to wrap the contents in. This should not be necessary, and Chrome and Firefox both use the existing inner editing host as the container.
The behavior seems to be more accurately reflected by:
If the container is not editable and the container is either not an editing host, or its parent is neither editable nor an editing host, ...
An alternative approach could be to change the "is editing host" logic to exclude elements with contenteditable set to true or plaintextonly that are children of an editable node or an editing host, which is the approach I took for Ladybird.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.