2ik / django-editorjs-fields

Django plugin for using Editor.js
MIT License
133 stars 33 forks source link

EditorJS does not handle pasting headers properly #56

Closed egor83 closed 1 year ago

egor83 commented 1 year ago

When I paste a copied HTML header (eg <h2>) into EditorJS field, it does not store the header properly, just completely ignores it. I tried to debug it: something happens in editor.save() method called here, and the followup .then(function (data) function receives empty data (data.blocks is an empty array). I tried digging into save() method: it seems that for some reason it receives tool: "Header", data: {text: '', level: 2}, although header's text is actually not empty.

When I do anything else in EditorJS field after pasting the header (eg just pressing Enter), it works fine and stores the header and the followup text properly.

Seems to be working fine with other non-header pasted text.

egor83 commented 1 year ago

Seems to be an EditorJS issue, not django-editorjs-fields, closing.