simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.01k stars 131 forks source link

mathjax render "\boldsymbol" will crash #204

Closed DIYer22 closed 1 year ago

DIYer22 commented 1 year ago

image

Here is the test markdown string

$$
\textbf{A}
\boldsymbol{A}
$$
simov commented 1 year ago

Interesting, maybe a trimmed the MathJax library too much. It seems like this is an extension that is not part of the Markdown Viewer v5 bundle. The reason why this works on Markdown Viewer v4 is because I was loading the library directly from cdnjs and therefore the entire build was available there. But with Markdown Viewer v5 I had to migrate to manifest v3 and therefore bundle all libraries with the extension, which is fine, but MathJax is a really large library so I tried to trim it down without knowing all of the specifics on how it works.

DIYer22 commented 1 year ago

At least the crash can be fixed first. If I turn on autoreload and change the md file, than markdown-viewer will not crash. But it still can't recognize "\boldsymbol", like this: image

simov commented 1 year ago

This was fixed in v5.1, now all tex/latex extensions for mathjax are bundled with the extension. You can take a look at the updated mathjax section of the mathjax examples that I used for testing this.