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

貢獻者指南