Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
<drupal-media data-caption="...">
wrapped with <a data-foo>
results in <a data-foo><drupal-media data-caption="<a>...</a>"></a>
when data-foo
support is added by GHS.
Steps to reproduce
- Create text format that has media library, media embed, image captioning and source editing enabled.
- Add
<a data-foo>
to the source editing supported elements - Create content using the newly created text format and use media library to embed media
- Add caption for the embedded media
- Use source editing to wrap the
<drupal-media>
element with<a href="http://example/llama" data-foo></a>
- Go back to editing and see that the caption now has a link
- Go back to source editing and confirm that there's a
<a>
inside thedata-caption
attribute.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#7 | 3268318-7-d93.patch | 73.5 KB | lauriii |
#7 | 3268318-7-d94.patch | 73.5 KB | lauriii |
#7 | 3268318-7-d10.patch | 73.34 KB | lauriii |
| |||
#5 | 3268318-5-test-only.patch | 2.04 KB | lauriii |
Comments
Comment #2
lauriiiComment #3
Wim LeersAdded to roadmap: #3238333-54: Roadmap to CKEditor 5 stable in Drupal 9.
Comment #4
Wim Leers@lauriii confirmed it is upstream and provided a failing test: https://github.com/ckeditor/ckeditor5/issues/11447 🚀
Comment #5
lauriiiComment #6
lauriii#3274767: Update to CKEditor 5 v34.0.0 has been committed.
Comment #7
lauriiiThe patch in #5 should still fail. Here are patches with the changes that are needed on our side.
Comment #10
tim.plunkett@lauriii linked me to https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_conversion_... which helped me understand this change. And the test coverage looks good. Thanks!
Comment #11
lauriiiThis issue won't be fixed for drupalImage so retitling and updating the issue summary. This problem for images should be handled in #3247634: [upstream] [drupalImage] Unlinking linked inline images while GHS is enabled: wrapping <a> is impossible to remove.
Comment #15
bnjmnmQuite a journey to identify the problem and have it addressed with a one line fix (not gonna count the build of course.
Committed to 10.0.x and 9.4.x. Backported since CKEditor5 is experimental and this is a nice bugfix.