Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

LinkImageEditing + ImageBlock in combination with ListEditing #16778

Open
Joel-Levi opened this issue Jul 22, 2024 · 4 comments
Open

LinkImageEditing + ImageBlock in combination with ListEditing #16778

Joel-Levi opened this issue Jul 22, 2024 · 4 comments
Labels
domain:ui/ux This issue reports a problem related to UI or UX. package:image package:link package:list support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@Joel-Levi
Copy link

📝 Provide detailed reproduction steps (if any)

Reproduction repo
(Open the index.html in the sample folder)

  1. Have an editor with LinkEditing, LinkImageEditing, ImageBlock, ListEditing. (No ImageInline)
  2. Paste the following as HTML ( or use setData() )
<ul>
 <li>
  <a href="https://ckeditor.com" target="_blank" rel="noopener noreferrer">
   <img src="https://ckeditor.com/assets/images/illustration/home-banner.png" height="100px" width="100px">
  </a>
 </li>
</ul>

✔️ Expected result

A list with an image link get pasted

❌ Actual result

The link is thrown out. There is only a list with an image
I'm not 100% sure if this is a bug or not, it might be expected behavior on CK's end?

📃 Other details

  • Browser: All
  • OS: All
  • First affected CKEditor version: ?
  • Installed CKEditor plugins:
    Essentials,
    ImageBlock,
    LinkEditing,
    LinkImageEditing,
    Paragraph,
    ListEditing,
    Undo

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

@Joel-Levi Joel-Levi added the type:bug This issue reports a buggy (incorrect) behavior. label Jul 22, 2024
@Witoso
Copy link
Member

Witoso commented Jul 23, 2024

Hmm, I reproduced it in the builder as well, it shouldn't result in such data change.

Curious, why do you use *Editing plugins, any particular reason?

@Witoso Witoso added package:image package:link package:list domain:ui/ux This issue reports a problem related to UI or UX. labels Jul 23, 2024
@Reinmar
Copy link
Member

Reinmar commented Jul 23, 2024

This is a tricky one. Pasting a linked inline image inside a list, while there's no inline images support.

The expected behavior: this should be turned into a linked block image and either "leave" the list or stay within it. The latter would be better from data preservation perspective.

It's tricky because it's a combination of 3 features and it's not a happy path (it needs to be picked up by the block image converters).

Definitely a bug, but might not be an easy one to fix.

@Joel-Levi
Copy link
Author

Hmm, I reproduced it in the builder as well, it shouldn't result in such data change.

Curious, why do you use *Editing plugins, any particular reason?

We are writing our own toolbar from scratch, so we do not need the UI part.

@mabryl
Copy link
Contributor

mabryl commented Jul 23, 2024

This will work when the linked image is wrapped in the <figure> element that typically surrounds block images in CKE5. An example can be seen in this StackBlitz.

Removing the <figure> from initialData will make the issue appear.

@aldonace-wu aldonace-wu added the support:2 An issue reported by a commercially licensed client. label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:ui/ux This issue reports a problem related to UI or UX. package:image package:link package:list support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

5 participants