tylingsoft / markdown-plus

Markdown editor with extra features.
http://mdp.tylingsoft.com/
2.12k stars 391 forks source link

Hangs if I have large images (desktop) #77

Closed john-cj closed 7 years ago

john-cj commented 7 years ago

This is a bug report for desktop version.

When I have markup like this:

foo

![](img/foo1.png)

![](img/foo2.png)

bar

![](img/bar.PNG)

abc

![](img/abc.PNG)

xyz

...

(all images are cropped screenshots, about 1600x500px), the program stops to respond and I forced to close it without saving.

As I understand, it's because program cannot correctly sync code and preview panes, since the images are quite big (in pixels measurement, not in megabytes).

tylerlong commented 7 years ago

Which platform are you talking about? Windows or Mac?

How many screenshots are there in total? I would like to reproduce it first.

john-cj commented 7 years ago

Windows 7 32bit (without Service Packs), also installed Net Framework 4.5.2 and Visual C++ redistributable packages for Visual Studio 2013. There are 4 screenshots in document. The text itself (without images) is about 6 pages long. I will try to reproduce a bug, and make a document for your test purposes.

Currently all works just fine, but yesterday I successfully reproduced this bug 2 times.

tylerlong commented 7 years ago

If you can reproduce it again, please provide me with your markdown document (remove confidential information first). Thank you.

john-cj commented 7 years ago

As I discoverd, the problem wasn't caused by images. Instead, it was caused by [toc] in the backticks. And this bug is really very minor.

This code will be rendered properly:

foobar: foo `[toc]` foo

But if you try to write it as 2 consequent lines, the rendering in the preview pane will be stopped. However, the program is not hanged. It is still working, you may write something or save your file.

foobar:
foo `[toc]` foo

rendering_fail

But if the word foobar was bold or italic, the program will stop to respond to your actions. So, you will not be able to write something or even to save the file. The only option is just to close the window.

**foobar:**
foo `[toc]` foo

It should be noted, that this bug occurs only for [toc] and only if the word foobar have colon (:) after itself. If you change the word [toc] to [tob] or if you remove the colon, the bug will not be reproduced.

tylerlong commented 7 years ago

Wow! Interesting find! I confirm it is an issue. Let me see what is wrong.

tylerlong commented 7 years ago

Fixed. Please test again here: http://mdp.tylingsoft.com/

You might need to refresh your browser several times to clear the cache.

I am going to update the apps in next couple of days.

john-cj commented 7 years ago

Tested, fixed.

Your editor is really very good. By the way, since your editor is based on the markdown-it parser, and since markdown-it have 100% Commonmark support (as stated on it's page), you may decide to add your editor in that list: https://github.com/jgm/CommonMark/wiki/Applications-supporting-CommonMark. So, the more users will know about it.