Closed juanhurtado10 closed 3 years ago
Please find the list
Device, Browser, OS:
Editor.js version: 2.22.0
Plugins used with their versions:
editorjs/checklist
(1.3.0), editorjs/delimiter
(1.2.0), editorjs/header
(2.6.1)editorjs/link
(2.3.1)editorjs/list
(1.6.2)editorjs/paragraph
(2.8.0)editorjs/underline
(1.0.0)editorjs-text-color-plugin
(1.1.22)Hi @komaldembla, @juanhurtado10
I've checked the issue and I noticed it is not related to the undo plugin.
Editor.js does not manage a line break as an empty block or an empty paragraph block then, the undo plugin just can't restore it because this is not even persisted into the history stack:
There are workarounds to solve this:
But definitely, a root solution may be done on the editor.js core. Here are some references:
Best, Juan Gaviria
Thanks for the quick response here @MrJuanGaviriaK! I'll check the workarounds.
@komaldembla @MrJuanGaviriaK
https://user-images.githubusercontent.com/1649973/132592356-07366fb1-227a-42b5-ad22-ae9e48517610.mov
After researching, I found that the following config allows the Undo plugin to recover the empty blocks.
paragraph: {
class: Paragraph,
inlineToolbar: true,
config: {
preserveBlank: true,
},
},
...
@juanhurtado10 - Thank you so much! This works :)
Context
https://user-images.githubusercontent.com/20125027/129673632-f1ec0d96-123f-46b2-b1b7-fc32fbe5089c.mov