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

Keep generating extra <strong> elements during each cycle of editing #5430

Closed zwnormal closed 1 year ago

zwnormal commented 1 year ago

Type of report

Bug

  1. Switch to Source, and paste the following html into the editing area:
    <p><strong/></p>
    <p><strong>Personal</strong></p>
    <p>&nbsp;</p>
  2. The result needs to be saved somewhere
  3. Load the previous saved result again into the ckeditor, switch to Source, the html becomes
    <p>&nbsp;</p>
    <p><strong><strong>Personal</strong></strong></p>
    <p><strong>&nbsp;</strong></p>
  4. Repeat step 2 & step 3, each time bunch of extra strong elements are added.

Init analyse showing most likely the extra strongs are added by this.editor.dataProcessor.toHtml, and further check it might relevant to data = CKEDITOR.htmlParser.fragment.fromHtml( data, evtData.context, fixBodyTag ); and the htmlparser ckeditor/core/htmlparser.

Expected result

No extra strong element is added.

Actual result

Each adding cycle keeps adding more and more strong element.

Other details

zwnormal commented 1 year ago

Figure out its our issue during each saving we actually convert <strong></strong>, to , so trigger the next adding of <strong></strong>.