Add media embed alignment feature#20126
Conversation
pszczesniak
left a comment
There was a problem hiding this comment.
The two /* istanbul ignore if: paranoid check ... */ annotations don't match ckeditor5-image/src/imagestyle/converters.ts and similar checks in other features:
- Downcast - image-style skips the guard entirely and uses a non-null assertion on
mapper.toViewElement(...). I suggest the same here. - Upcast - image-style has the same
!data.modelRangecheck without coverage suppression. The branch is reachable, so a small test could cover it for real.
Other than that - good job 👍 it looks really good and works as expected :)
| { name: 'alignLeft', label: t( 'Left aligned media' ), icon: IconObjectInlineLeft }, | ||
| { name: 'alignBlockLeft', label: t( 'Left aligned media' ), icon: IconObjectLeft }, | ||
| { name: 'alignCenter', label: t( 'Centered media' ), icon: IconObjectCenter }, | ||
| { name: 'alignBlockRight', label: t( 'Right aligned media' ), icon: IconObjectRight }, | ||
| { name: 'alignRight', label: t( 'Right aligned media' ), icon: IconObjectInlineRight } |
There was a problem hiding this comment.
You need to add those missing translation keys to the contexst.json in lang folder.
There was a problem hiding this comment.
Thanks! All suggestions applied.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit eb2e34f. Configure here.

🚀 Summary
Adds the
MediaEmbedStyleplugin to align media embeds, with optional text wrapping.Configuration options similar to those available in the image style plugins will be delivered in a follow-up ticket: #20131
📌 Related issues
🧾 Checklists
Use the following checklists to ensure important areas were not overlooked.
This does not apply to feature-branch merges.
If an item is not relevant to this type of change, simply leave it unchecked.
Author checklist
Reviewer checklist
t()(if any).