'CKEditor 5 get last insert value

Good day. How to get last insert value from CKEditor 5 ?

I use:

editor.model.document.on('change:data', () => {
    let data = editor.getData();
    console.log('The data has changed!', data);
});

It return all text from editor when change event started but I need return only last insert. Is it possible ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source