Formatting lost when attempting to add/edit paragraph within a list item in CKEditor 5

Created on 1 December 2023, almost 2 years ago
Updated 5 December 2023, almost 2 years ago

Problem/Motivation

This is a similar issue to https://www.drupal.org/project/drupal/issues/3381557 πŸ› [DrupalMedia] Formatting lost when attempting to edit media within a list item in CKEditor 5 Fixed .

Steps to reproduce

Create a list using CKEditor 5 and attempt to insert a paragraph into a list item. The list will be split into two lists and the paragraph inserted either inbetween, before, or after.

Example:

Before paragraphs embed:

<ul>
    <li>
        Test1 Test2
    </li>
</ul>

After paragraph embed:

<ul>
    <li>
        Test1&nbsp;
    </li>
</ul>
<drupal-paragraph data-embed-button="callout" data-entity-label="Embed Callout" data-paragraph-id="9f2ab784-59be-41e1-a2b5-a22cb54a25a7" data-paragraph-revision-id="2400">&nbsp;</drupal-paragraph>
<ul>
    <li>
        Test2
    </li>
</ul>

Proposed resolution

I believe the issue is that the allowed HTML for CKeditor's Document List support (https://ckeditor.com/docs/ckeditor5/latest/features/lists/document-lists...) does not allow the drupal-paragraph element to be nested within a list. Is there anything in the CKEditor API that would allow drupal-paragraph to be explicitly able to be nested in list item?

Remaining tasks

-TBD

User interface changes

None.

API changes

None.

Data model changes

-TBD

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States zooney

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024