Skip to content

Undo issue related to editorjs #16

@sos-productions

Description

@sos-productions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    🚫 wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions