renderFromHTML is not awaiting clear() method
renderFromHTML is not awaiting clear() method. So rendering is started during async clear execution that can cause incorrect results.
Steps to reproduce:
await this.api.renderFromHTML(<some_big_html>);
Expected behavior: Internal logic should await clear() method before star rendering blocks
Device, Browser, OS: any
Editor.js version: 2.28.2
Hey @mrigne,
Does this fix the issue for you in the following situation ->
const editor = new EditorJS( . . . )
await editor.isReady
await editor.blocks.renderFromHTML( . . . )
const saved = await editor.save()
console.log(saved)
I've been testing this one locally and I believe the issue stems further than this function.
The above renderFromHTML goes via the processText method to BlockManager's paste.
Inside the BlockManager the window.requestIdleCallback method is ran which I found executes after my save is called
Thanks!