Copy Pasted content also carries over extra html tags EditorJS

286 Views Asked by At

I'm using EditorJS on my website and I've encountered this issue recently where copying over content from a google doc also pastes the text formatting for that text. On the previous version of EditorJS that I was using on an old website this wasn't an issue. In the underneath pictures you can see the result of copy pasting the same paragraph from a google doc:

Old version of editorJs enter image description here

New version of editorjs enter image description here

On the previous website I was using this version of the EditorJS and paragraph tool:

"@editorjs/paragraph": "^2.8.0",
"@editorjs/editorjs": "^2.19.0",

On the current one i'm using this version

"@editorjs/editorjs": "^2.27.2",
"@editorjs/paragraph": "^2.10.0",

In both cases I'm initializing the editor in the same way with pretty much the same configuration, I've added a few extra tools tools to the new editor, some ad-hoc, some from the recommended plugins.

I've tried downgrading to "@editorjs/[email protected]" and "@editorjs/[email protected]", thinking that there might be a difference in how code is sanitized between the different version, the result was the same.

I've also noticed that when I pasted this specific paragraph into the editor I get this error

enter image description here

I was wondering if maybe i'm doing something wrong and if there is any way i can remove the unecessary html code on paste.

Thank you!

0

There are 0 best solutions below