nshenderov / strapi-plugin-ckeditor

Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (Unofficial integration)
https://www.npmjs.com/package/@_sh/strapi-plugin-ckeditor
MIT License
95 stars 58 forks source link

CKEditor 5 Media library upload broken media file links #142

Closed kevinvugts closed 1 month ago

kevinvugts commented 5 months ago

Bug

When you upload images using the media library integration in the CKEditor, images are prefixed with the backendUrl as shown in the code from the sourcecode below:

https://github.com/nshenderov/strapi-plugin-ckeditor/blob/2b2932ddebc0801cb4a1c50f484da471012b8dd7/admin/src/components/Input/MediaLib/index.js#L16

Issue

This is causing issues when you upload images to an external provider, such as Azure, amazon s3 etc. Because it will prefix the urls with the backendUrl like so: "http://localhost:1337/https://bucket-name.blob.core.windows.net/conatiner/assets/. Which is obviously incorrect and thus resulting in images not being displayed correctly in the CKEditor.

When you disable the "Responsive friendly upload" from the Strapi Media Library settings. It works as expected, as the code attached above will not use the "srcSet" and thus setting the value to "url" instead. Which omits the issue since that url is not prefixed in the code.

Question

How can we account for this and support external upload providers as well?

Possible duplicates: #124

nshenderov commented 2 months ago

@kevinvugts Hey, are you still having this problem? I can't reproduce it, tried on AWS S3, and everything seems to work fine for me.

Screenshot from 2024-08-05 16-20-04

nshenderov commented 1 month ago

It seems that the issue is no longer relevant