codex-team / codex-team/editor.js

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

Open
#2,641 2 comments 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

I believe [`this.Editor.BlockManager.clear()`](https://github.com/codex-team/editor.js/blob/7ff5faa46f188aa9081b1fb19ed429173c140d9b/src/components/modules/api/blocks.ts#L209) 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();
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.