codex-team / codex-team/editor.js

calling renderFromHTML with empty string or blank tags causes crash when you click on the editor holder

Open
#1,985 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Describe a bug.

Just as the title says. This is the error you get:

```TypeError: Cannot read properties of undefined (reading 'holder')```

Steps to reproduce:
1. Go to [my codesandbox](https://codesandbox.io/s/editorjs-renderfromhtml-bug-repro-xpl50e?file=/src/index.js) to see a minimal reproduction of the error.
2. Click on where the editor should be, in the browser window.
3. Uncomment the other lines to see it fail with "" and see it pass with non-blank tags or non-blank strings.

Expected behavior:

The editor should render with no content.

Screenshots:
Screen Shot 2022-02-24 at 4 04 44 PM

Device, Browser, OS: macOS, codesandbox

Editor.js version: latest

Plugins you use with their versions: error happens independently from plugins

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.