-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support MathJaX v3 #1221
Support MathJaX v3 #1221
Conversation
src/resources/mathjax_preview.js
Outdated
@@ -14,7 +14,7 @@ if (typeof VPlantUMLServer == 'undefined') { | |||
} | |||
|
|||
new QWebChannel(qt.webChannelTransport, | |||
function(channel) { | |||
function (channel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please revert all these style changes, which makes the PR a mess. Thank you for your PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I formatted it.
@@ -10,7 +10,7 @@ | |||
<link rel="stylesheet" type="text/css" href="CSS_PLACE_HOLDER"> | |||
<script src="qrc:/resources/qwebchannel.js"></script> | |||
<!-- EXTRA_PLACE_HOLDER --> | |||
<script src="JS_PLACE_HOLDER" async></script> | |||
<script src="JS_PLACE_HOLDER" async id="MathJax-script"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MathJax v3 refers the <script>
itself because MathJaX loads some plugin dynamically by need, e.g., fonts, stylesheet. See also, http://docs.mathjax.org/en/latest/web/start.html#using-mathjax-from-a-content-delivery-network-cdn
src/resources/mathjax_preview.js
Outdated
@@ -36,6 +36,47 @@ var isEmptyMathJax = function(text) { | |||
return text.replace(/\$/g, '').trim().length == 0; | |||
}; | |||
|
|||
// MathJax v3 compat (http://docs.mathjax.org/en/latest/upgrading/v2.html#v2-compatibility-example) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You just modify the preview stuff. MathJax is also used in the read mode, like markdown-it.js
and markdown-template.js
. Do we need to change code in those places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I added this snippet to them.
I success to build this project in my local environment but it does not render equations correctly. Now, it worked!!! Could you give me a day? I cleanup this PR. |
Go ahead and take your time. :) |
Everything works fine even if markdown-it, showdown, hoedown, and marked. Could you check them again? |
I added scale option in |
Is cthml a typo? |
Oops, yes :p |
First of all, I like this awesome software!
As I'd like to use MathJaX v3 in VNote, I updated it. MathJaX v3 have a new plugin for bussproofs missing in the older versions. But I'm sorry for that I cloud not build this software in my local environment (ubuntu 18.04 and Qt5.9). While I finally didn't know why I could not build, I guess I can improve your software with this request. Could you test in your environment?