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

Mathjax 资源缺失及添加 license #928

Closed
leoleoasd opened this issue Feb 14, 2021 · 9 comments
Closed

Mathjax 资源缺失及添加 license #928

leoleoasd opened this issue Feb 14, 2021 · 9 comments
Assignees
Milestone

Comments

@leoleoasd
Copy link

编辑模式

  • wysiwyg 所见即所得模式
  • ir 即时渲染模式
  • sv 分屏编辑预览模式

描述问题

https://cdn.jsdelivr.net/npm/vditor@3.8.1/dist/js/mathjax/sre/sre_browser.js 404, 导致无法使用MathJax渲染公式。

期待的结果

截屏或录像

image

版本信息

  • 版本:3.8.1
  • 操作系统:MacOS
  • 浏览器:最新Chrome

其他信息

之前好像还可以

@leoleoasd
Copy link
Author

image
src/js/mathjax/tex-svg.js 中依赖了这个文件,但是并不存在

为什么不能使用npm依赖mathjax,而直接把源代码提交到仓库中呢?这么做违反了MathJax的协议

@leoleoasd
Copy link
Author

Mathjax的Apache协议中要求,有Mathjax代码的地方要附一份Apache License与版权声明。大致在本仓库中搜索了一下,没有找到。

@leoleoasd
Copy link
Author

我下载了一份mathjax,替换掉cdn中的dist/js/mathjax就好了。
如果简单的修复,只需要编译一份最新的mathjax(或者从jsdelivr下载),提交到src/js/mathjax即可。

leoleoasd added a commit to EduOJ/frontend that referenced this issue Feb 14, 2021
@Vanessa219
Copy link
Owner

以前是依赖 npm ,但是打包出来的懒加载不够优雅。可参考以前代码提交记录。
放在本地是为了让用户方便的统一切换 cdn。

@Vanessa219
Copy link
Owner

你的输入是什么会导致 404?这里无法重现

@leoleoasd
Copy link
Author

你的输入是什么会导致 404?这里无法重现

mathjax模式输入任意内容

@Vanessa219
Copy link
Owner

没有这个请求,我先把 license 加了吧。多谢。
image

@Vanessa219 Vanessa219 changed the title Mathjax/sre/sre_browser.js 404 Mathjax 添加 license Feb 15, 2021
@Vanessa219 Vanessa219 self-assigned this Feb 15, 2021
@Vanessa219 Vanessa219 added this to the 3.8 milestone Feb 15, 2021
Vanessa219 added a commit that referenced this issue Feb 15, 2021
@leoleoasd
Copy link
Author

leoleoasd commented Feb 15, 2021

重新测试了一下
image

右键渲染出来的mathjax公式,选择开启accessbility模式,mathjax就会加载以下4个js:
image
然后因为这个设置会保存,再刷新网页的话好像渲染就崩了

en.js的路径是 https://cdn.jsdelivr.net/npm/speech-rule-engine@3.1.1/lib/mathmaps/en.js, 其他三个分别位于sre和a11y目录下。

@Vanessa219
Copy link
Owner

原来要这样操作,已经可以重现,稍后修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants