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

CommentFileSizeAuthor
sample-text.txt28.57 KBsbrown1038
after-save.png59.74 KBsbrown1038
before-save.png59.71 KBsbrown1038

Comments

sbrown1038 created an issue. See original summary.

sbrown1038’s picture

Issue summary: View changes
quietone’s picture

Version: 11.3.x-dev » 11.x-dev
Priority: Major » Normal
Issue summary: View changes
Issue tags: -ckeditor5 +Possible duplicate

Hi, 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

sbrown1038’s picture

Since there is a workaround, changing status.

What is the workaround?

Thanks.

Steve

sbrown1038’s picture

Based 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.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

davidwhthomas’s picture

Issue tags: -Possible duplicate

This 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 to style="width:100%px;" attribute e.g.:

<table class="table" style="width:100%px;" cellpadding="0" cellspacing="0">

kateva14’s picture

We 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