codex-team/editor.js

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

オープン

#2,641 opened on 2024/02/28

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (1,985 件のフォーク)batch import
good first issue

Repository metrics

Stars
 (26,602 個のスター)
PR merge metrics
 (30d に merged 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();

コントリビューターガイド