- Issue created by @mehdib4
They asked the same here https://drupal.stackexchange.com/questions/317371/ckeditor5-no-add-attri...
- Status changed to Postponed: needs info
about 1 year ago 12:38pm 23 October 2023 As I mentioned at https://drupal.stackexchange.com/questions/317371/ckeditor5-no-add-attri..., both attributes are there in the HTML you posted, in both cases.
- Status changed to Active
about 1 year ago 12:44pm 23 October 2023 - 🇺🇸United States mark_fullmer Tucson
Thanks for reporting this. Out of curiosity, what is the use case for having these data attributes present in the rendered
<a>
tag?To be clear, if Drupal core preserves them, then Linkit should not strip them out during rendering, so this should be fixed.
- 🇳🇿New Zealand danwonac
I've got the same issue. The result is that the link is shown as /node/192 instead of the aliased URL. Adding the data-entity-* attributes into the tag manually results in the aliased URL.
We are having the same issue with the unwanted side-effect of the link showing the /node/xyz to our users instead of the desired aliased URL.
- 🇺🇸United States mark_fullmer Tucson
This seems to be similar to the problem reported in 🐛 Link attributes missing with bootstrap theme Active . Maybe we could look to see if the direction that issue is going also is a path forward for this issue?
- 🇸🇪Sweden mohammed motar
We have this problem in our environment. Has anyone made progress with this issue?
- Status changed to Closed: duplicate
11 months ago 2:54pm 25 January 2024 - 🇺🇸United States mark_fullmer Tucson
I think that this issue is a duplicate of 🐛 Links around media images break when edited, using Linkit and CKeditor Needs review , which has a patch that was provided within the last year. I'm going to mark this issue as a duplicate, and let's try to focus efforts on testing/updating the approach taken there.
- Status changed to Active
11 months ago 6:03pm 26 January 2024 - 🇺🇸United States mark_fullmer Tucson
I've updated the issue description to pinpoint where in the CKEditor 5 plugin the problem is occurring. Since this is the same approach taken in the Drupal issue ✨ Drastically improve the linking experience in CKEditor 5 Needs work , I've also called attention to this problem there:
https://www.drupal.org/project/drupal/issues/3317769#mr2909-note257784 ✨ Drastically improve the linking experience in CKEditor 5 Needs work
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Wow, thank you so much, @mark_fullmer, you saved @bnjmnm a lot of time at #3317769-140: Drastically improve the linking experience in CKEditor 5 → by explicitly documenting this problem on the core MR! 🤩 🙏 🤝
- Status changed to Postponed
10 months ago 4:14pm 16 February 2024 - 🇺🇸United States mark_fullmer Tucson
After looking at this a bit, I conclude this is blocked by a necessary change in Drupal core. The drupalMedia CKEditor implementation is designed to support links on media items inherently. In order for metadata attributes such as Linkit provides to work, they must be stored **on** the media element itself. Linkit cannot simply "wrap" the media item selection with its own link, since the drupalMedia link autocomplete takes precedence. In effect, drupalMedia will need to store link metadata such as 'data-link-entity-type', 'data-link-entity-uuid', and 'data-link-entity-metadata', in addition to what is shown below:
<drupal-media data-entity-type="media" data-entity-uuid="1a84ed8c-eaf8-4846-9c01-02133a15f8ef"></drupal-media>
Linkit on its own cannot add metadata to that object, as that is controlled by the drupalMedia plugin. This *will* be supported in Drupal core, with the change introduced in https://git.drupalcode.org/project/drupal/-/merge_requests/6277/diffs?co...
That change will be part of ✨ Drastically improve the linking experience in CKEditor 5 Needs work , which should be a better alternative for most use cases than Linkit. For less common use cases where Linkit still provides functionality that core doesn't, potentially this issue can be addressed after that change is in Drupal core.
- 🇸🇪Sweden mohammed motar
Hello
I wonder if there is a solution or a workaround until https://www.drupal.org/project/drupal/issues/3317769 ✨ Drastically improve the linking experience in CKEditor 5 Needs work solution is out. - 🇨🇦Canada mahde Vancouver
I am facing this issue as well using Drupal 10.2.6 and latest version of linkit 6.1.
Hope to have a fix for that.
Thanks!