Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
ckeditor5.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Mar 2023 at 11:04 UTC
Updated:
24 Aug 2023 at 01:15 UTC
Jump to comment: Most recent
Comments
Comment #3
wim leersComment #5
wim leersJust 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.
Comment #6
glynster commented@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!
Comment #7
fenstratNoting here that this blocks entities embedded via entity_embed from being linked to other content. That was possible in CKE4 thanks to #2511404: Image entities/fields embedded using Entity Embed cannot be linked in CKEditor
Comment #8
wim leersThanks for pointing that out, @fenstrat!
Comment #9
wim leersUpstream issue was created: https://github.com/ckeditor/ckeditor5/issues/13803
Comment #12
weseze commentedAdding 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)
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.
Comment #13
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. We are taking a look at this on the CKEditor side.
Comment #14
wim leersFixed upstream 10 hours ago! 🥳 https://github.com/ckeditor/ckeditor5/commit/371ae0bd057c0120fbf3e1f7581...
Comment #15
neclimdulMy 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!
Comment #16
wim leersUpdate patch now live at #3370989: Update CKEditor 5 to 38.1.0! 🤩
Comment #18
wim leers#3370989: Update CKEditor 5 to 38.1.0 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.
Comment #19
neclimdulThe 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?
Comment #20
wim leers@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 #3168966: Add ability to insert Media inline in CKEditor widget? Or perhaps it's #3075527: FilterAutoP breaks links around the <drupal-media> tag 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! 😊
Comment #22
acbramley commentedUnfortunately this still doesn't seem to work for entity_embed as detailed in #7
On 10.1.2 with
Embed patched with #3309747: Add CKEditor 5 compatibility and keep supporting CKEditor 4 (MR2 commit e4a16215)
Entity Embed patched with #3272732: Drupal 10 & CKEditor 5 readiness (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?