codex-team/editor.js

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

开放

#2,641 创建于 2024年2月28日

 (2 条评论) (0 个反应) (0 位负责人)TypeScript (1,985 个派生)batch import
good first issue

仓库指标

星标
 (26,602 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南