https://github.com/albertfdp/ckeditor-html-issue
A minimal reproduction repository demonstrating a bug in CKEditor 5 where the editor crashes when using Remove Format on content with empty span elements.
https://github.com/albertfdp/ckeditor-html-issue
Last synced: 11 months ago
JSON representation
A minimal reproduction repository demonstrating a bug in CKEditor 5 where the editor crashes when using Remove Format on content with empty span elements.
- Host: GitHub
- URL: https://github.com/albertfdp/ckeditor-html-issue
- Owner: albertfdp
- Created: 2025-03-06T13:36:10.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-11T06:56:10.000Z (over 1 year ago)
- Last Synced: 2025-03-24T21:03:42.748Z (about 1 year ago)
- Language: JavaScript
- Size: 118 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CKEditor HTML issue
This repository demonstrates a specific bug in CKEditor 5 when using the [General HTML Support](https://ckeditor.com/docs/ckeditor5/latest/features/html/general-html-support.html) plugin together with the [Remove formatting](https://ckeditor.com/docs/ckeditor5/latest/features/remove-format.html) feature.
You can see a video of the crash [here](https://drive.google.com/file/d/1mzhjdgmbDIH-PGqIcWDeWqbZdajCXJLh/view?usp=drive_link).
## Reproduction
The main issue occurs when:
1. The editor is configured to allow empty elements via the htmlSupport configuration
2. The content contains empty spans with class attributes
3. A user tries to use the "Remove Format" button from the toolbar
4. When these conditions are met, the editor crashes completely.
Example configuration for `htmlSupport`:
```js
htmlSupport: {
allowEmpty: ["span"],
allow: [{ name: "span", classes: true }],
},
```
Example content:
```html
Hello from CKEditor 5! here test
```
## Running the example
```sh
npm install
npm start
```