Problem/Motivation
tfoot element is lost during the conversion
Steps to reproduce
- Go to
- Open the source editing.
- Paste the following markup:
<table>
<thead>
<tr>
<th>Items</th>
<th scope="col">Expenditure</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Donuts</th>
<td>3,000</td>
</tr>
<tr>
<th scope="row">Stationery</th>
<td>18,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row">Totals</th>
<td>21,000</td>
</tr>
</tfoot>
</table>
- Switch back to the editing mode.
- Switch back to the source editing mode.
Expected result
tfoot is preserved.
❌ Actual result
tfoot is lost and merged to tbody.
For Reference See Attached Issue :-
https://github.com/ckeditor/ckeditor5/issues/12952
Comments
Comment #2
sahil432 commentedComment #3
sahil432 commentedComment #4
wim leersThanks for this issue! This is definitely blocked on https://github.com/ckeditor/ckeditor5/issues/12952.
Comment #5
smulvih2+1 I am running into this issue as well. In my case, my table is driving a JS chart, and adding the contents of
tfootintotbodyis causing the JS to fail.Comment #6
joseph.olstadNeeding a fix for this.
Comment #7
joseph.olstadWe've created a new module called please_replace_ckeditor5_with_tinymce
we added a text filter plugin in src/Plugin/Filter/TableTfootFixFilter.php
Enable this filter on all text formats using ckeditor5. What it does is replace the incorrect markup with the expected tfoot when the page is rendered.
We also have a other text filter plugins in the please_replace_ckeditor5_with_tinymce module called VideoCleanupFilter.php and SpanLinkFixFilter.php . Perhaps we will have to turn the please_replace_ckeditor5_with_tinymce module into a full contrib project so that others can get our text filter plugins that put a bandaid on content that would otherwise be broken by ckeditor5.
Comment #8
joseph.olstadPlease smash the thumbs up on this pull request that fixes the issue at the root which is in ckeditor it'self.
https://github.com/ckeditor/ckeditor5/pull/14276
and also the issue description it'self needs a thumbs up, smash that like button
https://github.com/ckeditor/ckeditor5/issues/12952
Comment #9
joseph.olstadGovernance issues.
https://github.com/ckeditor/ckeditor5/pull/14276#issuecomment-2815624337
Comment #10
joseph.olstadApparently there may be another way around this issue, from a message in slack drupal ckeditor5 channel.
Comment #11
joseph.olstadWe've published a contrib module that fixes ck5 tables . It is called CKEditor5 Table Fix
https://www.drupal.org/project/ckeditor5_table_fix
Comment #12
andrew.wang commentedIt seems that someone from CKEditor team (finally) picked this up yesterday: https://github.com/ckeditor/ckeditor5/pull/19582
Comment #14
joseph.olstadA fix was merged upstream
https://github.com/ckeditor/ckeditor5/issues/12952#issuecomment-3805179151
Here's what was merged:
https://github.com/ckeditor/ckeditor5/pull/19582
Haven't tested it, likely still need https://www.drupal.org/project/ckeditor5_table_fix until D11.4.0 or D11.5.0 and possibly beyond.
Comment #15
andrew.wang commentedThe upstream pull request is now merged and tfoot support is planned for v48!
Comment #16
joseph.olstadWhile it was merged, I suspect people will still want to use the ckeditor5_table_fix since it allows various markup including media to be embedded into tables and tfoot.
https://github.com/ckeditor/ckeditor5/issues/12952
With that said, once 48 lands in core, we'll review.