๐ Bug report
latest master
editor.model.document.registerPostFixer( writer => {
const changes = editor.model.document.differ.getChanges();
let wasChanged = false;
for ( const change of changes ) {
if ( change.type == 'insert' || change.type == 'remove' ) {
const textNode = change.position.textNode;
if ( change.name == '$text' && textNode && textNode.hasAttribute( 'bold' ) ) {
writer.removeAttribute( 'bold', textNode );
wasChanged = true;
}
}
}
return wasChanged;
} );
boldl (forward or backward delete)<paragraph><$text bold="true">bo[]d</$text></paragraph><p>bo[]l</p>The text after deletion is bod in the view.
The text after undo id bold in the view.
The text after undo has bold attribute in the model.
The text after deletion in the editing area is bol.
The text after undo id boll in the view.
The text after undo doesn't have bold attribute.
Screen cast:

ps.: The same happens on FF and Chrome.
I confirm the bug.
Quick observation: when removing, always the last letter is removed, unless the first letter is removed. When typing, the typing itself is fine but undo fails.
This is a bug in Differ. A quite serious one, it is funny that it didn't come up earlier but I guess we never had a scenario where a word changed an attribute and also got something removed/added.
Okaaay, so https://github.com/ckeditor/ckeditor5-engine/pull/1705 this fixes the issue with Differ. Attribute change was incorrectly stored if there was a remove change with intersecting range.
However, this does not fix not-bolding on undo. In fact, everything works correctly. The bold is applied, but since also there is a letter inserted (or removed) during the undo, the bold is immediately taken off.
So the post-fixer like this for mentions is not correct.
Most helpful comment
This is a bug in
Differ. A quite serious one, it is funny that it didn't come up earlier but I guess we never had a scenario where a word changed an attribute and also got something removed/added.