Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LHSnow opened this issue Feb 28, 2024 · 1 comment
Open

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

LHSnow opened this issue Feb 28, 2024 · 1 comment
Labels
area: extensions/widgets/markdown type: bug code to address defects in shipped code

Comments

@LHSnow
Copy link

LHSnow commented Feb 28, 2024

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.

@LHSnow LHSnow added the type: bug code to address defects in shipped code label Feb 28, 2024
@nathancatania
Copy link

I am also hitting this error. Hopefully I can provide some additional details that will help.

Crash log

get@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2731209 leaf@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2731814 leaf@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2721273 marks@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2721793 2826/t.default@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:477:15111 hasMark@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:473:11045 render@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:473:3329 As@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2187548 Os@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2187346 El@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2230681 wu@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2218886 yu@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2218814 vu@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2218675 au@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2215482 uu@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2215871 qi@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2156746 52967/iu/<@http://127.0.0.1:8888/assets/external/unpkg.com/decap-cms@%5E3.0.0/dist/decap-cms.js:485:2213423

This is currently running on ocalhost, but the crash is occurring on my live site as well.

To reproduce

  • Create a bulleted list with a few items
  • Turn the last item into a link
  • Press enter which will create a newline/new bullet, which as you type will still be formatted as a link (another bug in itself).
  • Try to delete/backspace the last bullet that is still being formatted as the link. As soon as you press backspace, the CMS should crash.

Images

Screenshot 2024-03-18 at 4 23 41 pm

Screenshot 2024-03-18 at 4 24 00 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: extensions/widgets/markdown type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

3 participants