ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.78k stars 2.46k forks source link

Js error on Chrome when CKEDITOR.dtd.$removeEmpty['p'] = 1 #5511

Closed hdumazeau closed 1 year ago

hdumazeau commented 1 year ago

Type of report

Bug

Provide detailed reproduction steps (if any)

I reproduce the bug on the demo page (https://ckeditor.com/ckeditor-4/demo/) by modifying: CKEDITOR.dtd.$removeEmpty['p'] = 1;

A JS error seems to occur in this function: https://github.com/ckeditor/ckeditor4/blob/45995cb4173614e5582c2954573a2c147d571e74/core/editable.js#L2794C2-L2803C3

To reproduce:

On Firefox I don't have the problem, but on several versions of chrome I do.

Expected result

What is the expected result of the above steps? No js error and correct reformatting

Actual result

What is the actual result of the above steps?

Uncaught TypeError: Cannot read properties of null (reading 'equals') at r (ckeditor.js:362:87) at $. (ckeditor.js:389:198) at b.k (ckeditor.js:10:246) at b. (ckeditor.js:12:91) at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js:13:285) at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.keystrokeHandler.g (ckeditor.js:246:144) at $.k (ckeditor.js:10:246) at $.fire (ckeditor.js:12:91) at HTMLBodyElement. (ckeditor.js:65:66)

Other details

jacekbogdanski commented 1 year ago

CKEditor 4 reached the end of life in June already. You can read more about available options in our readme, as unfortunately, we no longer provide code changes in the open-source version: https://github.com/ckeditor/ckeditor4#summary-of-options-after-the-ckeditor-4-end-of-life