Expected: <p><b>a</b> []</p>
Actual: <p><b>a</b>[]</p>
I pushed ckeditor5-typing@t/ckeditor5/1083 with a temporary fix.
It looks like a regression - it was fixed here: https://github.com/ckeditor/ckeditor5-engine/pull/1204
Yes and no. The bug was there all the time. Or rather – lack of functionality. It manifested itself once we enabled support for <br>s.
The problem was in what's @pomek and @scofalik were pinging me for some time – lack of support for diffing not-only-text content:
@ma2ciek I think this is a little different case. This one takes place in typing. It was "hidden" earlier because we didn't convert <br />. Now we do and it messed up some algorithms in typing.
As far as the solution goes, it looks okay for now. However, I don't like this part of code
// Skip situations when common ancestor has any elements (cause they are too hard).
if ( !hasOnlyTextNodesOrBrs( modelFromDomChildren ) || !hasOnlyTextNodesOrBrs( currentModelChildren ) ) {
return;
}
Which caused the bug. The moment we will allow more inline elements that will be rendered, the bug will manifest again.
Actually, there is a problem with indexes even now if we will have a "real" <br /> inside the text. So we need to do something to keep the indexes correct. Unfortunatelly, simply changing non-texts to a character won't work correctly cause the Firefox'es bogus br will be changed to that character and inserted.