codex-team/editor.js

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

Open

#2.641 geöffnet am 28. Feb. 2024

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (26.602 Stars) (1.985 Forks)batch import
good first issue

Beschreibung

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