GHS lists integration causes the editor to fire post-fixer directly after loading initial data #16227
Labels
package:html-support
squad:collaboration
Issue to be handled by the Collaboration team.
support:2
An issue reported by a commercially licensed client.
type:bug
This issue reports a buggy (incorrect) behavior.
Milestone
馃摑 Provide detailed reproduction steps (if any)
<ul class="myUl"><li>A<ol class="myOl"><li>B</li></ol></li></ul>
as the editor data.htmlUlAttributes
from the second list item.What happened here:
<ol>
) but also, incorrectly, from its ancestor (<ul>
).htmlUlAttributes
from a list item that has numbered type.But this creates unnecessary operation and causes problems with real-time collaboration. Instead, we should build the correct model while upcasting.
A simple fix is to change this line of code:
https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-html-support/src/integrations/list.ts#L219
to:
However, maybe it would be good to refactor this whole conversion here.
Right now, when we have nested lists, we revisit the same model list items over and over again, for each nesting (e.g. if we have
ul > ul > ol > li
, model element for thisli
will be visited when processingol
, then when processingul
, and then when processingul
again, and this is why this condition was needed but was incorrectly implemented and didn't work for different list elements).I understand difficulties of upcasting (we don't have mapper, we need to traverse
data.modelRange
as the original view element may got split, etc.) but maybe there is a chance to write it in a way that the integration will provide a converter only forelement:li
?But this is only a bonus task. The performance isn't that problematic -- we add some extra iterations but they are limited only to number of indentations, which should be several at most.
The text was updated successfully, but these errors were encountered: