We’ve recently upgraded to the latest version of Drupal 10.2.x and CKEditor 5. One issue immediately noticed after upgrading to CK5 is that when using the CK5 format option for text fields, it randomly adds <p>
tags around most content without being specified to do so. For example, I’ve created a basic unordered list with a few child <li>
and when viewing the source code, each line of text is wrapped in a <p>
tag first, before being wrapped in the specified <li>
.
Example:
<ul>
<li>
<p>list item one content...<p>
</li>
<li>
<p>list item two content...<p>
</li>
<li>
<p>list item three content...<p>
</li>
</ul>
This is happening for unordered lists (), ordered lists (), images (), and most HTML elements except for headings ( ). When viewing the source code via the source option in the CKEditor 5 toolbar, I’ve tried manually removing the injected <p>
tags but once switching back to the WYSIWYG view, the <p>
tags are automatically restored in the markup.
Has anyone else experienced this behavior when using CKEditor 5? Any help would be appreciated.
Thanks!
Steve Case is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.