-
Notifications
You must be signed in to change notification settings - Fork 43
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
Some images load, some show load icon, some doesn't #90
Comments
The code fetching the images is a bit dodgy... It would need to be re-written. Basically, the image is only updated when the whole preview is updated (basically when you press a key). There is currently no callback which re-renders the preview as soon as the image has finished loading. So, if you wanna see the pictures, you have to type in things (space backspace in repeat would work). Having a callback is technically possible though, it's just not implemented yet, mainly because the code is quite messy and I don't have a hip of free time right now (I'm passing the HSC), but that should change soon 🙂 |
@math2001 can you assign me into this issue ? I'm interested. |
Hey, thank you for wanting to contribute ❤️! Here's probably where you wanna start: MarkdownLivePreview/image_manager.py Lines 62 to 73 in d4c4777
Just to give you my personal opinion: this package is just a stack of bad code, disorganized and unclear. I think everything should be re-written, properly. It's still possible to add in this feature, but don't feel bad if you don't feel like it's going to be worth the effort 🙂 |
Thanks a lot for assigning me. My opinion is - why don't we try to fix this thing, |
I've unassigned you because I have rewritten MarkdownLivePreview, and this issue is now fixed really cleanly. It turned out to be a lot easier to implement than I original thought, and I probably could now do it in the current code base. The whole package needed to be re-written anyway, just to make it easier for people to contribute. It's only on my computer for now, but it should arrive soon 🙂 |
Its awesome. |
This is fixed by This is how the "image manager" (just a function) is used: MarkdownLivePreview/markdown2html.py Lines 60 to 65 in 192f61b
And this is the "image manager" MarkdownLivePreview/markdown2html.py Lines 99 to 138 in 192f61b
|
I was reading codes from a project. Then for some reasons, I thought I should be reading .md file offline. Then I came to know about this - MarkdownLivePreview.
Now, when I started reading the .md file I had, I noticed something different.
One picture is being rendered, other is not.
But the link is fresh and live, here
Here is a snap :
And sometimes it shows a loading like image:
The text was updated successfully, but these errors were encountered: