suever/MarkdownPanel

MarkdownPanel no longer works on MatLab 2021 or older.

Opened this issue · 7 comments

Dear author,

I'm happy to find out your repo.
However, from what I have, your util is not working on MatLab 2021 and 2022.

I check that It's working on MatLab 2018,
But on MatLab 2021, MarkdownPanel.demo() is stuck at rendering HTML output.
On MatLab 2022, this error appears instantly:

Error using MarkdownPanel/refresh
Java exception occurred:
java.lang.UnsupportedOperationException

	at com.mathworks.mlwidgets.html.HTMLRendererSupport.executeScript(HTMLRendererSupport.java:49)

	at com.mathworks.mlwidgets.html.HTMLRenderer.executeScript(HTMLRenderer.java:875)

	at com.mathworks.mlwidgets.html.HtmlComponentAdapter.executeScript(HtmlComponentAdapter.java:143)


Error in MarkdownPanel/set.Options (line 327)
            self.refresh(true);

Error in MarkdownPanel (line 158)
            self.Options = struct(...

Error in MarkdownPanel.demo (line 405)
            panel = MarkdownPanel( ...

The error caused by self.htmlComponent.executeScript(jscript);, the method executeScript no longer exists on MatLab 2022.

So could you please update your script, I found a new uihtml that intro by MatLab (Introduced in R2019b): https://www.mathworks.com/help/matlab/ref/uihtml.html

But I need something like your script which is written in Java and support from 2014 and older.

I just released v2.0.0 which should work on newer versions of MATLAB. Let me know if it works for you, thanks!

I just released v2.0.0 which should work on newer versions of MATLAB. Let me know if it works for you, thanks!

It's working on my R2022a. Thx u for that.
However, the performance of this script seems to not good compared to GUIDE.

Thanks for the feedback, I'm working on a GUIDE version now and should have one to test out in the next day or two. Ideally it will allow the user of either uifigure or figure. I will let you know what I have that on a branch for testing

@DoHaiSon I just pushed v2.2.0 to the File Exchange which reverts to using GUIDE but also ensures support for recent versions of MATLAB. If you can try it out and let me know how it works for you, I would appreciate the feedback. Thanks

@DoHaiSon I just pushed v2.2.0 to the File Exchange which reverts to using GUIDE but also ensures support for recent versions of MATLAB. If you can try it out and let me know how it works for you, I would appreciate the feedback. Thanks

Thx Jonathan,
I tested the new script on both R2022a (Windows) and R2015b (Ubuntu).

For R2022a, the new version seems to clearly improve the performance when it loads the demo function. At least two times faster.
For R2015b, I faced an error: "Error downloading URL. Your network connection may be down or your proxy settings improperly configured."

On that machine are you able to download the following file? https://cdn.rawgit.com/showdownjs/showdown/1.3.0/dist/showdown.min.js

On that machine are you able to download the following file? https://cdn.rawgit.com/showdownjs/showdown/1.3.0/dist/showdown.min.js

Oh, I see. That machine cannot automatically download the .js file from the internet like R2022 can do.
I downloaded this file and put it into this folder. The script worked.