sibiraj-s / ngx-editor

🖋️ Rich Text Editor for angular using ProseMirror
https://sibiraj-s.github.io/ngx-editor/
MIT License
424 stars 183 forks source link

[BUG]: Broken image thumbnail is not displayed in the editor #309

Closed Maks-Yaremenko closed 3 years ago

Maks-Yaremenko commented 3 years ago

I'm submitting a

Description

You can successfully add an image using the add image tool, then you have to delete the image on the server. After you'll load a document that contained a deleted (on the server) image, the broken image won't be reflected in the document - but it will be there.

Version Information

ngx-editor: 5.2.0
angular: 9.1.9

Browser

sibiraj-s commented 3 years ago

@Maks-Yaremenko Please follow the issue template.

Issue title and issue description are totally different.

Maks-Yaremenko commented 3 years ago

okay, fixed. sorry

sibiraj-s commented 3 years ago

based on my understanding I updated the title. can you confirm if that is the bug?

sibiraj-s commented 3 years ago

Can you paste the document sample with which you are facing the issue

Maks-Yaremenko commented 3 years ago

no no, incorrect. Let me explain - You can successfully add an image using the add image tool, then you have to delete the image on the server. After you'll load a document that contained a deleted (on the server) image, the broken image won't be reflected in the document - but it will be there.

I can confirm that the broken image is still in the document because it is reflecting when I'm rendering HTML data using inner HTML in any blocks.

sibiraj-s commented 3 years ago

Oh. got it. the broken thumbnail is not showing up.

Maks-Yaremenko commented 3 years ago

yes, exactly!

Maks-Yaremenko commented 3 years ago

ps: is there a way to pass custom validator for image link? I am facing issues with some URLs, that contain сyrillic fonts, or some characters... like times.. for example when an image has dimensions like 1200x1500

sibiraj-s commented 3 years ago

Can you open a new discussion for that? lets keep the discussion here for this issue alone

Maks-Yaremenko commented 3 years ago

Do you mean request?

sibiraj-s commented 3 years ago

no here https://github.com/sibiraj-s/ngx-editor/discussions/categories/q-a

sibiraj-s commented 3 years ago
Screenshot 2021-01-08 at 3 56 07 PM

@Maks-Yaremenko I was able to see the broken thumbnail when I tested it.

sibiraj-s commented 3 years ago

@Maks-Yaremenko Let me know if this is an issue or can be closed

Maks-Yaremenko commented 3 years ago

I can confirm that the thumbnail exists in the record of the document, but not reflecting in the editor.

in editor (image exist on the server) image

in HTML (image exist on the server) image

in the editor (the image was removed from the server, no placeholder in the editor) image

seems like after clicking multiple times in the place where the image should locate I can select its block image

in the HTML (the image was removed from the server, placeholder shows correct thumbnail) image

ps: sad to me that you making all fixes for the latest version... I tested it and unfortunately unable to update the existing implementation to use the newer version, too many errors occur to me. None of the versions starting from 5.3 not working for me.

sibiraj-s commented 3 years ago

ps: sad to me that you making all fixes for the latest version...

Migrating to v6 is very straightforward. Can you refer this one to upgrade https://sibiraj-s.github.io/ngx-editor/#/migration-5-6 let me know if you face any issues. I will assist you along the migration.

sibiraj-s commented 3 years ago

v6 allows to extend features very easy both internally and for developers too. I heavily recommend you to upgrade it.

Maks-Yaremenko commented 3 years ago

yes, I used this guide to migrate to a newer version but received errors with childCount, same as on v 5.3. + I created a wrapper to use editor inside mat-form-field, so I got some style issues during migration. Unfortunately, I'm not allowed to spend any more time with the editor on my project. Probably I'll try to migrate one more time after work hours.

sibiraj-s commented 3 years ago

Sure.

sibiraj-s commented 3 years ago

Thanks for sharing the screenshots I was able to reproduce that. The Images without alt text is the ones that doesn't have thumbnails. The rest works fine. I will debug this.

Maks-Yaremenko commented 3 years ago

Thank you! You are doing a great job!

sibiraj-s commented 3 years ago

Thanks. Consider a star for the project. If you like the work.

Maks-Yaremenko commented 3 years ago

done)

sibiraj-s commented 3 years ago

Turns out it is just a css issue. Fixed in v6.1.0-beta.1.

Since you have v5. I suggest a small patch.

.NgxEditor img {
  height: 100%;
}
Maks-Yaremenko commented 3 years ago

thank you a lot!

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in the thread.