Closed (fixed)
Project:
Drupal core
Version:
10.1.x-dev
Component:
ckeditor5.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2023 at 08:59 UTC
Updated:
30 Jun 2025 at 03:45 UTC
Jump to comment: Most recent
Comments
Comment #3
wim leersComment #4
wim leersBased on the test results at #3379104-7: Add a "CKEditor 5 nightly" GitLab CI job, I expect that
will cause some tests to fail — but likely this means a simplification on our end, since we won't need to work around it anymore 🤞
Comment #5
wim leersHm, looks like this is causing a genuine regression:
👆 when
$unrestricted === TRUE, we expect that thatclass="trusted"is retained. That is no longer true once we update to39.0.1. 🐛When
$unrestricted === TRUE, Drupal will have:i.e. it will enable the GHS that allows EVERYTHING.
It looks like https://github.com/ckeditor/ckeditor5/commit/3d155169b2cad4b40330059382b... introduced a genuine regression against this 🤔 Or maybe we need to change our logic in
core/modules/ckeditor5/js/ckeditor5_plugins/drupalImage/src/drupalimageediting.jsEither way, this is causing a net regression. 🙈
On our side, only @lauriii can figure this out efficiently. He’ll be back from vacation next week. Assigning to him. Welcome back, Lauri 😜
Comment #7
longwaveLooks like this is ready for review but I don't know enough about the change to make it RTBC.
Comment #8
wim leers@lauriii, could you add some comments explaining why this change is needed? Why is https://github.com/ckeditor/ckeditor5/commit/3d155169b2cad4b40330059382b... not handling this for us? I hoped/expected that we'd be able to delete code rather than add more.
Especially because the conditionality in that upstream commit:
… indicates that the necessary upcasting should be added only if
LinkImageis loaded, and\Drupal\Tests\ckeditor5\FunctionalJavascript\ImageTest::setUp()does place thelinktoolbar item, which means that the CKEditor 5LinkImageplugin should be loaded according to:And hence I thought we'd be able to delete the "image link GHS" integration code on our end:
which we had introduced in #3246168: Images are not linkable through UI; already linked images are unlinked (data loss!) (before it was added to core!).
Comment #9
lauriiiThe DrupalImage plugin heavily customizes the way Image plugin works. The key difference being, that we never wrap images with a
<figure>in the data view.It turns out that the commit mentioned in #8 adds more assumption to the CKEditor 5 linked image upcast process. In particular, it assumes that the link is inside the
imageBlockelement. This is not true in the case of Drupal, because in our case<img>is directly converted intoimageBlock, meaning that the link is wrapping theimageBlockelement.We could try to document this inline in the JavaScript file, but I want to point out that majority of the code in that same file exist for this same reason.
Comment #10
wim leersI think just adding #9 as a comment to the modified file would indeed be sufficient 😊👍
Comment #11
lauriiiTried to write down #9 in the code docs 👍
Comment #12
wim leersNo more concerns — thanks! 😊
🚢
Comment #13
longwaveCommitted and pushed 5cc339ea60 to 11.x and 4befb2b456 to 10.1.x. Thanks!
Comment #16
longwaveComment #17
wim leersLovely, thank you! 😊 🚀
Comment #18
eduardo morales albertiIs it possible to also apply it on Drupal 9.5.x? we have some problems with inline styles and the remove format button #3321254: [upstream] Remove Format button does not remove `style` attributes from block-level elements
Comment #19
wim leers@Eduardo Morales Alberti No, not possible. Other contrib modules will break. If you are using no CKEditor 5 contrib modules, then you could.
But it'll have to be you doing it for your site, an official release Drupal 9.5 release with this would break countless sites.
Comment #20
eduardo morales albertiLet's see then how we fix the inline styles format remove scenario because is something important on our site and we have contrib modules not compatible with Drupal 10.x (yet).
Thank you.
Comment #21
wim leersWish there was more I could do — but our hands are tied! Good luck 😊 Personally, I'd look into getting those contrib modules on D10!
Comment #23
quietone commented