As Undo plugin need an inital state
`
function initUndo() {
undo = new Undo({editor});
editor.save().then((outputData) => {
//console.log('Article data: ', outputData) //strong tags are washed where are they are allowed in config
var initialData=outputData
undo.initialize(initialData.blocks);
}).catch((error) => {
console.log('Saving failed: ', error)
});
}
`
and in my paragaph plugin config, I have
paragraph: {
text: {
type: "string",
allowedTags: "i,b,u,a[href],strong,em,br,br,dt,dl,embed,ol,li,ul"
}
}
but edtor sanitize at least strong tag (and I guess others too) on editor.save()
/**
* Saving example
*/
saveButton.addEventListener('click',(e) => {
editor.save().then((savedData) => {
alert(savedData.toSource()) //<strong> dissaper
});
});
`
so when I undo, I got only text with br tag preserved in paragraph
As Undo plugin need an inital state
`
function initUndo() {
`
and in my paragaph plugin config, I have
paragraph: {
text: {
type: "string",
allowedTags: "i,b,u,a[href],strong,em,br,br,dt,dl,embed,ol,li,ul"
}
}
but edtor sanitize at least strong tag (and I guess others too) on editor.save()/**
* Saving example
*/
`
so when I undo, I got only text with br tag preserved in paragraph