Trumbowyg
Trumbowyg copied to clipboard
History Plugin does not restore Image twice
Informations
Firefox 64.0.2 Mac OS X
How to reproduce the bug?
- Go to https://alex-d.github.io/Trumbowyg/demos/#plugins-history
- Clear text in editor (important)
- Paste small image into editor
- Place cursor behind image and delete via Backspace
- Undo via History button - works
- Place cursor behind image again and delete via Backspace
- Undo via History button - does not work (image is not restored)
- Weird: click Undo button again - the text will reappear
In fact, this bug has nothing to do with images. The same problem occurs if, for example, a character is typed instead of an image pasted. The second undo does not work, because the internal stack gets messed up and an empty string is restored from it (instead of the actual content that was deleted).