codex-team/editor.js

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

Open

#2.641 aberto em 28 de fev. de 2024

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)TypeScript (1.985 forks)batch import
good first issue

Métricas do repositório

Stars
 (26.602 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

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

Guia do colaborador