Problem/Motivation
When copying aligned block images from one CKEditor instance to another (same page or different page), the alignment is lost, and it appears there is a fallback alignment.
When viewing the source, the <img>
element is wrapped in a <figure>
element with proper alignment, the source for the pasted version is an <img>
element wrapped in a <span>
.
The problem does not occur on the CKEditor demo pages on their website, however, it does occur on a vanilla Drupal 10 site stood up on simplytest.me, leading us to believe the problem is related to the integration.
The problem only appears to be related to when you use the "Insert Image" button, but does not seem to happen if you insert an image with media library.
Steps to reproduce
- Edit a content type form with at least one CKEditor field instance. The CKEditor instance must have the "Insert Image" button activated in the menu
- Click "Insert Image" in the CKEditor instance and add an image
- Align the image to the middle
- Select all and copy to clipboard
- Paste into a different CKEditor instance in your Drupal site (can be the same content type)
- The alignment for the image is wrong