tip: prefill an empty editor with `<p><br></p>` to avoid a small bug
- Dominant language
- JavaScript
- Stars
- 12k
- Forks
- 546
- PR merge metrics
- No merged PRs in 30d
Description
like this:
```
if (initBody) {
editor.content.innerHTML = initBody;
} else {
editor.content.innerHTML = '
}
```
Most of the time images get inserted inside `
` tags. But if the user starts uploading images before he writes even a single letter, the image will be inserted at the top level since there's nothing else there.Oh and will also need this in case user writes something and deletes it all again (in which case Pell sets it back to completely blank):
```
onChange: (html) => {
if (html === '') {
editor.content.innerHTML = '
}
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating Pell's editor initialization and onChange handling, using the empty-content and image-insertion behavior described in the issue. Inspect how the editor handles an empty body before and after text is deleted. Done means images inserted into an empty editor use the same paragraph structure as images inserted after text, without leaving the content completely blank.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100