Install
Works with Drupal: ^10.3 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
ckeditor5_roundtrip 1.0.4
Bug fix: authored image dimensions are preserved on save.
An image that combined a pixel width (the width attribute and/or a style width) with max-width lost its width when the content was saved. CKEditor 5 writes an image’s natural size as width and height attributes after it loads, and moves a style width into a width attribute. The previous cleanup in AlignmentRoundtrip could not tell those injected values from authored ones, so it removed both.
AlignmentRoundtrip now records the dimensions the author wrote each time content enters the editor (initial load and every Source-mode toggle) and restores exactly those values on save. Images resized in the editor keep their new size. Images with no authored dimensions keep the previous behaviour.
Changes
AlignmentRoundtrip: restore authored image width/height attributes and style values on save.
New FunctionalJavascript test: ImageDimensionsRoundtripTest (pixel and percentage widths, max-width, injected natural size, same-source images, repeated saves).
Code comments cleaned up (no functional change).
Compatibility: built against CKEditor 5 47.6, as shipped with current Drupal core. No configuration changes and no update hooks.