- Issue created by @ericgsmith
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
I am assuming this will need to be either a bug or feature request upstream in CKEditor - but reporting here first to get feedback / ideas.
+1 😅 Glad you thought of this already! 🙏
In CKEditor5 the
colgroup
andcol
elements are removed from the markup when editing - even when added to "Manually editable HTML tags" or when using Full HTML format.This sounds like a bug in CKEditor 5's
Table
plugin's integration with theirGeneralHtmlSupport
plugin.Please repeat this bug report upstream, including your sample markup to reproduce it. 🙏
In short - I believe
col
andcolgroup
elements should be supported without requiring theTableColumnResize
plugin / allowing full HTML. The practicalities of that approach I am unsure of.It is not possible to support these additional elements automatically when the
Table
plugin/UI is enabled, because:{ "name": "Table column resize", "className": "TableColumnResize", "description": "Adds support for table column resize, which allows to set the width of each column in a table using a resize handle.", "docs": "features/tables/tables-resize.html", "path": "src/tablecolumnresize.js", "requires": [ "Table" ], "htmlOutput": [ { "elements": "colgroup" }, { "elements": "col", "styles": "width" } ]
— https://github.com/ckeditor/ckeditor5/blob/v39.0.0/packages/ckeditor5-ta...
👆 only that additional CKEditor 5 plugin is able to create those elements. But you're right that it should be possible to support them manually through the use of GHS (which in Drupal indeed corresponds to configuring them as ).
- 🇳🇿New Zealand ericgsmith
Thanks Wim - appreciate the direction of where to look. I've opened upstream bug https://github.com/ckeditor/ckeditor5/issues/15368
- Status changed to Postponed
over 1 year ago 9:12am 17 November 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Note that actually just a few days ago I finished 📌 [Style] Warn the user about styles for unsupported elements Needs work , which would warn you immediately that this is not yet supported. That should mitigate the frustration, but it won't unblock you. So keeping this issue around … waiting for an upstream fix :)
- 🇳🇿New Zealand ericgsmith
Possibly because ✨ Add table.TableColumnResize for formats with arbitrary HTML supported RTBC isn't committed yet, I seem to be able to define these elements in a custom plugin without anything complaining that table resize already defines them.
It might break when that issue lands but for now I'm working around using https://www.drupal.org/project/ckeditor5_colgroup → which I've published if anybody else is in the same situation and needs a short term fix.
Hopefully this gets traction upstream and I can abandoned that work around
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
📌 [Style] Warn the user about styles for unsupported elements Needs work just made this easier to discover 👍