- 🇺🇸United States joshuami Portland, OR
Adding some use cases to this issue.
- An editors uses media library to embed a document into an unordered or ordered list.
- An editor uses media library to embed an image into a list.
CKEditor 5 supports this per https://ckeditor.com/docs/ckeditor5/latest/features/lists/document-lists....
- 🇺🇸United States joshuami Portland, OR
After a bit more research with some sites I'm trying to upgrade to D10 with CKEditor5, I think this may be more of a potential data-loss bug than a task.
If a site has used Media Library and embedded media into a list (ordered or unordered doesn't matter), those lists will be corrupted on the first edit of the entity after enabling CKEditor5.
While Document Lists (see my previous comment) in CKeditor5 allow paragraphs and images to be inserted into a list—retaining the nesting of those elements within the list item—you cannot do the same with a drupal-media element. I'm not immediately sure why as you can technically manually add divs. I think it might be because drupal-media elements are not explicitly allowed within CKEditor's DocumentList allowed HTML.
I'm not seeing the same issue with tables. You can have a drupal-media element with a table cell and it doesn't force that to break out of the table cell in the way that it forces the list to break into two list elements.
Can anyone else reproduce this? Do you agree it would be data loss since there is no path to editing the content that has this pattern?
- 🇫🇮Finland lauriii Finland
That sounds like it should potentially get a new issue. This issue was filed for documenting a very specific opinion that CKEditor 5 has, which is that
<td>
and<li>
may contain text without an additional<p>
element, but yet those elements don't behave like other text wrappers like<p>
or<div>
.