Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual decorators for LinkImage lost upon upcast #10828

Closed
wimleers opened this issue Nov 9, 2021 · 2 comments · Fixed by #10829
Closed

Manual decorators for LinkImage lost upon upcast #10828

wimleers opened this issue Nov 9, 2021 · 2 comments · Fixed by #10829
Assignees
Labels
package:image package:link squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@wimleers
Copy link

wimleers commented Nov 9, 2021

📝 Provide detailed reproduction steps (if any)

Discovered while working on https://www.drupal.org/project/ckeditor5/issues/3247683.

  1. Load the following CKE5 plugins: image.Image, image.ImageToolbar, image.ImageUpload, link.Link, link.LinkImage, with the following Link config:
"{"decorators":[{"mode":"manual","label":"Foobarize","attributes":{"foo":"bar"}}]}"
  1. Instantiate CKEditor 5 on a textarea containing markup like:
<p><a href="http://www.drupal.org/association" foo="bar">test link</a> and <a href="http://www.drupal.org/association" foo="bar"><img src="/sites/default/files/inline-images/dark_14.png"></a></p>

🎥 Screencast

image link decorators

✔️ Expected result

Same markup as before, with foo="bar" retained on both the linked text and the image.

❌ Actual result

foo="bar" is retained only on the linked text not on the image.

❓ Possible solution

Bug in upcasting.

📃 Other details

  • Browser: N/A — reproduced in Chrome and Firefox.
  • OS: N/A — reproduced in macOS Big Sur
  • First affected CKEditor version: v31.0.0
  • Installed CKEditor plugins: see above.

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@wimleers wimleers added the type:bug This issue reports a buggy (incorrect) behavior. label Nov 9, 2021
@wimleers
Copy link
Author

wimleers commented Nov 9, 2021

#6571 seems related?

@Reinmar Reinmar added squad:core Issue to be handled by the Core team. package:image package:link labels Nov 10, 2021
maxbarnas pushed a commit that referenced this issue Nov 12, 2021
…decorators

Fix (link, image): Manual decorators on the linked inline images should be preserved while loading editor content. Closes #10828.
@AnnaTomanek AnnaTomanek added this to the iteration 49 milestone Nov 16, 2021
@rmaxx
Copy link

rmaxx commented Feb 22, 2022

👍seeing same results on link classes after installing imagelink plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:image package:link squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
5 participants