ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Pasted image should be a block image by default

Open Reinmar opened this issue 2 years ago • 2 comments

Scenario:

  1. Type something
  2. Paste an image
  3. Press Enter to keep typing in a new line below the image:

WAT? Where's my image?

https://user-images.githubusercontent.com/156149/178748475-ed2c23d5-65da-4533-becb-378dca69218a.mp4

So, what happened is that despite how it looked, this image was pasted as an inline image and got selected. It didn't look like an inline image cause it was huge. So I pressed Enter to start typing below the image (this is how it worked before we introduced inline images and how it works e.g. in Notion). But then – boom :boom: Image is lost.

It took me a minute to figure out what's happening. I strongly believe that in a huge majority of cases, block images are the way to go. But the absolute minimum is to fix the heuristic so pasting at the end of line gets you a block image.


If you'd like to see this improvement implemented, add a 👍 reaction to this post.

Reinmar avatar Jul 13 '22 13:07 Reinmar

BTW, inline images in GitHub Writer makes nearly zero sense. I'll report an issue about this too because I think that at least for now, before we'll polish the UX it made no sense to enable inline images there.

Reinmar avatar Jul 13 '22 13:07 Reinmar

Scope: Just do minimal thing (... is to fix the heuristic so pasting at the end of line gets you a block image).

The place with heuristic: https://github.com/ckeditor/ckeditor5/blob/e86c4029b1b4ea184f2451f23b24ce603afead55/packages/ckeditor5-image/src/image/utils.js#L109-L125

arkflpc avatar Sep 21 '22 08:09 arkflpc

I ran into this again when trying to force an integration with Strapi's media library to insert images as block images. Since it relies on toView() -> toModel() -> insertContent(), I have no control over this. Probably it's be the same if I relied on the insert image command, but relying on the former makes it easier to handle image replacement.

Reinmar avatar Oct 28 '22 12:10 Reinmar

👆 For the ref: https://github.com/ckeditor/strapi-plugin-ckeditor/pull/14

Reinmar avatar Oct 28 '22 12:10 Reinmar

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar Oct 31 '23 05:10 CKEditorBot

Duplicate: #15158.

arkflpc avatar Oct 31 '23 07:10 arkflpc