Skip to content

Deleting a bullet point in rich text editor crashes CMS #7123

@LHSnow

Description

@LHSnow

Describe the bug

When editing main content using the rich text editor (markdown widget), deleting a bullet point causes the editor to crash and replace the entire CMS with an error page.

The console reports Uncaught Error: Cannot find a descendant at path [3,0,1] in node (or whatever the nested xpath position of the bullet point was, I am assuming).

The page contains the entire text in json format and after that in markdown, for ease of keeping unsaved edits for later (nice!).

To Reproduce

  1. Make several bullet points in the rich text editor, for example
  • alpha
  • bravo
  1. Delete "alpha", leaving the bullet empty
  2. Hit backspace to delete the bullet
  3. See error

Expected behavior

Bullet point should disappear and the caret should stay on an empty line

Applicable Versions:

  • Decap CMS version: 3.1.1
  • Git provider: GitLab
  • OS: Ubuntu 22.04.4 LTS
  • Browser version Firefox 123.0, Chrome 122.0.6261.57

CMS configuration

- label: 'Content'
  name: 'body'
  widget: 'markdown'
  required: false
  i18n: true

Additional

This error does not occur in the demo Slate editor, but does nothing when hitting backspace, a behavior which is also unintuitive, i.e. having to klick on the bullet point button to delete the empty point. Would it go away with a dependency update or is the bug caused by Decap? I did notice at Discord that we are moving towards Plate instead, but is there a dependency update that could be done in the meantime. I'd rather have a somewhat unintuitive behavior than a broken one.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions