codex-team/editor.js

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

Ouverte

#2 641 ouverte le 28 févr. 2024

 (2 commentaires) (0 réaction) (0 personne assignée)TypeScript (1 985 forks)batch import
good first issue

Métriques du dépôt

Stars
 (26 602 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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

Guide contributeur