Install
Works with Drupal: ^10.3 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
New plugin: Inline Run Roundtrip
ckeditor5_roundtrip_inline_run keeps inline content (a <span>, text, a link) exactly as authored where CKEditor 5 would otherwise wrap it in a <p>.
The CKEditor 5 model cannot hold bare inline content at the top level, in a <blockquote>, or next to block siblings, so it wraps each such run in a paragraph. A <p> is a block with its own margins, so the layout changes:
<span style="color:red;">A</span> becomes <p><span style="color:red;">A</span></p> <div><span>A</span><div>B</div></div> becomes <div><p><span>A</span></p><div>B</div></div>
With this plugin those cases come back as written. Paragraphs you wrote yourself are never touched.
- Handled: the top level and
<blockquote>always;<div>,<td>and<th>when they also contain a block-level child. - Pressing Enter inside such a run still produces two real paragraphs, so lines never run together.
- Like the other plugins, it has no toolbar button and no settings.
Fixed: vertical-align:super and vertical-align:sub were removed
CKEditor 5's Superscript and Subscript plugins claim vertical-align: super|sub on any element and turn it into their own attribute. The style was consumed, so it was lost:
<sup style="vertical-align:super;">1</sup> became <sup>1</sup> <span style="vertical-align:super;">1</span> became <sup>1</sup>
The second case also changed the element, and browsers render <sup> in a smaller font. ckeditor5_roundtrip_inline_style now keeps the style and the element as written on <sup>, <sub> and <span>. The toolbar's Superscript and Subscript buttons behave as before, and other vertical-align values were never affected.
Fixed: missing configuration schema
ckeditor5_roundtrip_style and ckeditor5_roundtrip_alignment had no configuration schema entry, so an editor configuration that lists either plugin could fail with a SchemaIncompleteException. Both now have one, as does the new plugin.
Tests
- 31 new tests (84 in total: 83 FunctionalJavascript and 1 unit).
PluginSchemaTestfails for any plugin defined inckeditor5_roundtrip.ckeditor5.ymlwithout a schema entry, so the gap above cannot return.LinkSpanRoundtripTestguards styled spans that wrap, or sit inside, a link. It checks computed styles rather than exact markup, so it survives CKEditor upgrades that re-nest spans.
Known limitations
- Two adjacent
display:blockspans are still merged into one by CKEditor 5. This is not addressed here. - On a text format that restricts attributes on
<p>, inline runs fall back to CKEditor's default paragraph wrapping.
Upgrading from 1.0.0 or 1.0.1
No database updates and no configuration changes are required. Clear caches after updating so Drupal discovers the new plugin and library.