verbb / vizy

A flexible visual editor for Craft CMS
Other
43 stars 8 forks source link

Content diseapears when inserting empty bullet list item #239

Closed scandella closed 11 months ago

scandella commented 11 months ago

Describe the bug

My users are freaking out because some content disappears after saving! It seems that when some empty bullet lists are present in the content (see attached screenshot), the CP text area can't display it whereas the web view shows it without issue. Anyway, somehow, this structure seems to cause the issue: {"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","attrs":[],"content":[{"type":"text","marks":[{"type":"textStyle"}],"text":" qui articulent pratique, rencontre et connaissance."}]}],"text":""},{"type":"listItem","content":[null],"text":""}]}

Removing the null node makes the content reappear.

I was unable to reproduce the problem by inserting an empty bullet point, but my user may be copying some content from Word or whatever…

CleanShot 2023-07-12 at 17 07 50@2x

Steps to reproduce

  1. Somehow, create a bullet list with one empty paragraph
  2. Save the entry
  3. Re-open the entry
  4. The admin is empty, but the live preview shows the content
  5. Freak out

Craft CMS version

Craft Pro 4.4.15

Plugin version

2.1.7

Multi-site?

No

Additional context

No response

engram-design commented 11 months ago

Fixed for the next release. To get this early, run composer require verbb/vizy:"dev-craft-4 as 2.1.7"

scandella commented 11 months ago

Thanks, the fix works. Keep up the good work.