Install

Works with Drupal: ^10.3 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 148.5 KB
MD5: 67a5f100fff88dff8379f2da1310aa1e
SHA-1: 1497af2f7ce1c6e6ffbe06260606ec04d714feda
SHA-256: 174163b75ea23aae08edb7fb8b853ccd572aa241f9adea5f1cdf8dc623a6d3bb
Download zip 206.59 KB
MD5: 621fcb60a31bce92e6aef5fb89677f4c
SHA-1: da036294d26e48784272caec27a7bb0b92b4932e
SHA-256: b0c274d156a88ec0177fc919e33717420f9f14b01905b3cf5f573743a538be00

Release notes

New plugin:
attribute roundtrip

ckeditor5_roundtrip_br preserves class and style attributes on <br> tags.

CKEditor 5's soft-break model element carries no attributes, so any class= or style= on a <br> is silently dropped:

<br class="d-block" style="display:none">   becomes   <br>

This plugin replaces each such <br> with a GHS-compatible <span> proxy before the HTML is parsed, then converts it back when the data is written. No toolbar button, no settings.

New plugin: table cell attribute roundtrip

ckeditor5_roundtrip_table_cell preserves three table and cell attributes that CKEditor 5 discards as default values:

  • margin:0 auto on <table>. The Table plugin's style normaliser expands the margin shorthand and drops auto (not a numeric length), so a centred table loses its centring:
    margin:0 auto   becomes   margin-top:0;margin-bottom:0
  • align="left" on <td> and <th>. CKEditor treats left as the default for <td> and omits it on downcast. For <th>, browsers default to center, so removing align="left" changes the visible layout.
  • valign and vertical-align:middle on <td>/<th>. middle is CKEditor's internal default for vertical cell alignment and is omitted on downcast. Authors who write both valign="middle" (for email clients) and style="vertical-align:middle" (for browsers) lose both on the first save.

All three use a stash-and-restore approach: a private data attribute is set before parsing and removed when the data is written back. No toolbar buttons, no settings.

Fixed: radio inputs in <form> wrapped in <p>

Radio inputs that share a &lt;form&gt; with a &lt;table&gt; were wrapped in a &lt;p&gt; by ckeditor5_roundtrip_inline_run. This broke CSS :checked + sibling carousel selectors. &lt;form&gt; is valid HTML5 flow content; it now joins &lt;blockquote&gt; in the always-wrap list.

Fixed: image-only <label> deleted in table cells

An &lt;img&gt; inside a &lt;label&gt; inside a &lt;td&gt; or &lt;th&gt; was consumed by CKEditor's Image plugin, leaving the &lt;label&gt; as an empty inline element that was then discarded. This deleted carousel arrow and accordion toggle controls that use image-only labels. ckeditor5_roundtrip_inline_run now wraps inline runs inside table cells unconditionally, which preserves the label.

Fixed: percentage CSS width moved to HTML attribute and height injected

ckeditor5_roundtrip_alignment Fix 3 (remove pixel dimensions injected on CSS-sized images) is extended to also handle percentage widths:

&lt;img style="width:100%" alt=""&gt;
  becomes  &lt;img width="100%" height="100%" alt=""&gt;   (CSS property removed)

&lt;img style="width:50%;max-width:200px" alt=""&gt;
  becomes  &lt;img style="max-width:200px" width="50%" height="50%" alt=""&gt;

Both cases are now restored: the percentage width goes back to the style attribute and the injected height attribute is stripped.

Tests

  • 83 FunctionalJavascript tests, 1119 assertions.
  • 1 failure was a pre-existing Drupal login timing flake (the test logged in successfully but the redirect assertion raced the page load); it passes when re-run alone.
  • Verified in a live Full HTML editor with Playwright, through the author path (paste source, toggle, Save to database) for all eight defects.

Upgrading from 1.0.2

No database updates and no configuration changes are required. Clear caches after updating so Drupal discovers the two new plugins and their libraries.

Created by: nishchit.dayal
Created on: 12 Nov 2026 at 15:01 UTC
Last updated: 12 Nov 2026 at 15:02 UTC
Bug fixes
New features

Other releases