Skip to content
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

Upgrade MathJax to 3.2.2 #63

Merged
merged 8 commits into from
Jan 6, 2024
Merged

Conversation

leimao
Copy link
Contributor

@leimao leimao commented Dec 30, 2023

  • Updated MathJax CDNs.
  • Updated MathJax Configs for MathJax 3.

@leimao
Copy link
Contributor Author

leimao commented Jan 5, 2024

@ppoffice

package.json Outdated Show resolved Hide resolved
matchFontHeight: false
},
SVG: {
matchFontHeight: false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新版MathJax没有matchFontHeight设置了么?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是个好问题,我之前参考V3.2的文档就直接把这个设置抄过来了,然后数学显示看上去还是没啥问题的。

更新日志,这个matchFontHeight在V3.2之后的确对于SVG是没有了。

不过对于HTML这个变量似乎还是有的,需要加上去吗?

我其实不是很确定该如何设置,还希望你对这个PR测试一下,严格把一下关。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议加上。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我加好了,请您测试一下。


return (
<>
<script type="text/x-mathjax-config" dangerouslySetInnerHTML={{ __html: js }}></script>
<script dangerouslySetInnerHTML={{ __html: js }}></script>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

官方文档的意思,我是不是在这里还得加一个 type="text/javascript" id="MathJax-script" async?


return (
<>
<script type="text/x-mathjax-config" dangerouslySetInnerHTML={{ __html: js }}></script>
<script src={jsUrl} defer={true}></script>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ppoffice 我把这个defer attribute 给删除了,您看看我这么做合理吗?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为你用async替换了defer而且这个script在HTML的底部所以差别不大。

@ppoffice ppoffice merged commit 0dc59c2 into ppoffice:master Jan 6, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants