Problem/Motivation
When content is saved, centering of the main table that contains the article is lost.
Steps to reproduce
1. Create new content that includes a CKEditor body with full HTML.
2. Set CKEditor 5 body to Source mode.
3. Paste text from attached sample file.
4. Set body to WYSIWYG mode. In edit mode, the article will appear to be centered (see "before" image attached).
5. Save the content. In view mode, the article will appear to be left justified (see "after" image attached)
Additionally, I have to manually re-center all images included in the article.
Proposed resolution
I'm not sure if this is related but I noticed several instances of "width:100%px" (percent and px for pixel - should be one or the other) which were not there until after the save. Before saving, there was only one instance of "width:100%" (without px).
Also, not sure what caused this change -- Drupal Core and CKEditor5 Plugin Pack were both recently updated.
Remaining tasks
Check if this is a duplicate of #3408961: [upstream] CKEditor 5 table properties' "center alignment" does not work
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| sample-text.txt | 28.57 KB | sbrown1038 | |
| after-save.png | 59.74 KB | sbrown1038 | |
| before-save.png | 59.71 KB | sbrown1038 |
Comments
Comment #2
sbrown1038 commentedComment #3
quietone commentedHi, in Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies. Thanks.
Since there is a workaround, changing status.
This may be a duplicate of #3408961: [upstream] CKEditor 5 table properties' "center alignment" does not work
Comment #4
sbrown1038 commentedWhat is the workaround?
Thanks.
Steve
Comment #5
sbrown1038 commentedBased on what I've seen in issue 3408961, I don't think this is a duplicate of that. For one, that is a fairly old issue that's probably been resolved because my content was fine until last week when I did an update that included both Drupal and CKEditor 5 Plugin Pack. Since then, the outermost table which is centered in edit mode becomes left justified when I save it. Further, the left justified paragraphs of text become centered when saved.
Comment #7
davidwhthomas commentedThis is not a duplicate. There are two separate issues, one where table alignment is broken and this one where an invalid width attribute is added to the table, also breaking the layout:
it appears to change a
width="100%"attribute tostyle="width:100%px;" attributee.g.:<table class="table" style="width:100%px;" cellpadding="0" cellspacing="0">Comment #8
kateva14 commentedWe updated to 10.6.3 this week and this issue appeared in CK Editor. If you use width="20%" CK Editor adds "px" to the end making it width="20%px". It seems this issue has been marked closed on CK Editor's github account. Do we know when the fix will come to Drupal?
Thanks,
-K