codex-team / codex-team/editor.js

[Bug] Pasting italic/bold text causes `DOMException: Failed to execute 'setStart' on 'Range'`

Open
#2,102 2 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

The editor causes an error when pasting all _italic_ and/or **bold** text as `html`

Steps to reproduce:
1. Open Notes.app, type any text and make it all italic/bold, copy it to the clipboard
2. Go to https://editorjs.io/, open the browser's console
3. Paste the text into the editor
- this text is represented by the following `html`
```html

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Helvetica Neue'}

Lorem Ipsum

```
- if it was partially italic/bold then the error would not appear in the console
5. Observe the error appeared in the console `Uncaught (in promise) DOMException: Failed to execute 'setStart' on 'Range':`.
However, the actual text does get placed in a new Paragraph block (works as expected).

Expected behavior:
The editor pastes all italic/bold text without throwing an error.

Screenshots:
![image](https://user-images.githubusercontent.com/17523218/179601947-677c9ea6-e027-44b9-af36-31110233acfb.png)

https://user-images.githubusercontent.com/17523218/179604962-9863873b-ff3e-43d3-b896-a9a2156f45c3.mov

Device, Browser, OS:
Chrome v102.0.5005.115, macOS v12.3.1

Editor.js version:
v2.25.0
v2.24.3

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.