codex-team/editor.js

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

Open

#2641 aperta il 28 feb 2024

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)TypeScript (1985 fork)batch import
good first issue

Metriche repository

Star
 (26.602 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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();

Guida contributor