- Issue created by @wim leers
- Status changed to Postponed
over 1 year ago 12:02pm 23 March 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Just discussed with @Reinmar — this is on their radar, and they have enough information for them to act on this. This is likely complicated by the fact that the Link plugin needs to know if the wrapped content is a block or inline element, and that is non-trivial for GHS-powered elements.
- 🇺🇸United States glynster
@Wim Leers thanks for looking into this further. We tried all sorts of workarounds and we hit a deadend. What helped us was to use the following module ckeditor5_embedded_content. Then we created our own plugins as needed. This has actually been pretty awesome as any extra markup and so forth all resides within the template. For our case this was needed as we had hundreds of articles with ad blocks in them. The custom code was there in ckedtor 4 and as soon as we switched and saved any of them, the links vanished!
- 🇦🇺Australia fenstrat Australia
Noting here that this blocks entities embedded via entity_embed from being linked to other content. That was possible in CKE4 thanks to ✨ Image entities/fields embedded using Entity Embed cannot be linked in CKEditor Fixed
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Upstream issue was created: https://github.com/ckeditor/ckeditor5/issues/13803
- 🇧🇪Belgium weseze
Adding another use case that is probably caused by the same issue here.
For our ckeditor4 -> 5 migration testproject we noticed all our custom anchors are disappearing.
We are using https://www.drupal.org/project/anchor_link → in ckeditor4 for this. There is currently no support for ckeditor5 for this module.
But in our migration we had hoped to simply leave this module out and allow content editors to add and edit anchors in ckeditor source code: (since it is rarely used anyway)...html... <a id="my_anchor"></a> ...more html...
Our config allows a-tag and id attributes on them.
But they are still filtered out...Updating to a cke5 comatible version of the "anchor_link" module would likely solve the issue (once it is released)
But I see no reason that empty a-tags with an id would be filtered out. This is a valid use case to make anchor-points in content. - 🇵🇱Poland witeksocha
@weseze most likely it's this upstream: https://github.com/ckeditor/ckeditor5/issues/9888, and related Drupal issue: https://www.drupal.org/project/drupal/issues/3337298 🐛 [upstream] [GHS] CKEditor 5 removes empty inline elements Fixed . We are taking a look at this on the CKEditor side.
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Fixed upstream 10 hours ago! 🥳 https://github.com/ckeditor/ckeditor5/commit/371ae0bd057c0120fbf3e1f7581...
- 🇺🇸United States neclimdul Houston, TX
My understanding of the explanation was it provided the tools to fix it and there may be some additional work for Drupal to fully support it for things like entity embedding. But exciting!
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Update patch now live at 📌 Update CKEditor 5 to 38.1.0 Fixed ! 🤩
- Status changed to Fixed
over 1 year ago 11:20am 5 July 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
📌 Update CKEditor 5 to 38.1.0 Fixed landed, the fix is shipping with
10.1.1
! 🥳Crediting @lauriii for the testing he did at #3370989-8: Update CKEditor 5 to 38.1.0 → .
- Status changed to Needs work
over 1 year ago 5:22pm 5 July 2023 - 🇺🇸United States neclimdul Houston, TX
The original example does work but entity embedding is still very broken so this isn't really solved for me. What's the next steps to be able to get that working?
- Status changed to Fixed
over 1 year ago 9:00am 10 July 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
@neclimdul
\Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest::testLinkability()
proves that this actually does work.\Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest::testLinkedMediaArbitraryHtml()
proves this even works in more complex cases.You must be doing something even more complex, or there must be some contrib/custom logic causing this to break.
Or maybe you're trying to do ✨ Add ability to insert Media inline in CKEditor widget Needs work ? Or perhaps it's 🐛 Adding links around embedded media through CKEditor might lead to invalid/complex markup when rendered Active that you're reporting? If it's neither of those two issues, please create a new bug report with exact steps to reproduce starting from a vanilla Drupal 10 site. I promise I'll investigate as soon as I have concrete steps to reproduce! 😊
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
about 1 year ago 1:15am 24 August 2023 - 🇦🇺Australia acbramley
Unfortunately this still doesn't seem to work for entity_embed as detailed in #7
On 10.1.2 with
Embed patched with 📌 Add CKEditor 5 compatibility and keep supporting CKEditor 4 RTBC (MR2 commit e4a16215)
Entity Embed patched with ✨ Drupal 10 & CKEditor 5 readiness Fixed (MR12 commit c9970f19)@Wim Leers while those tests prove the markup may work, the functionality doesn't seem to work in the actual WYSIWYG.
When I embed an entity, in my case Media (yes we need to migrate to media library but that's another story), the Link button is greyed out when selected on the embedded entity.
However, I now see that this issue was about
<a>
tags being stripped, not about supporting the link button with embedded entities. Perhaps we need a new issue?