codex-team/editor.js

this.Editor.BlockManager.clear() should be awaited in renderFromHTML()

Open

#2,641 opened on Feb 28, 2024

View on GitHub
 (2 comments) (0 reactions) (0 assignees)TypeScript (26,602 stars) (1,985 forks)batch import
good first issue

Description

I believe this.Editor.BlockManager.clear() should be awaited in renderFromHTML() to prevent errors.

The following example highlights the issue: data.blocks will often be empty as a result of not awaiting clear().

await $editorApi.blocks.renderFromHTML(html);
const data = await $editorApi.saver.save();

Contributor guide

this.Editor.BlockManager.clear() should be awaited in renderFromHTML() · codex-team/editor.js#2641 | Good First Issue