fluid-dev / hexo-theme-fluid

:ocean: 一款 Material Design 风格的 Hexo 主题 / An elegant Material-Design theme for Hexo
https://hexo.fluid-dev.com/
GNU General Public License v3.0
7.25k stars 1.13k forks source link

1.9 + 版本公式渲染错误 #783

Closed zywvvd closed 2 years ago

zywvvd commented 2 years ago

问题描述

在升级 fluid 到1.9 + 版本后MathJax 公式在电脑的 谷歌浏览器不能正常显示,但是在 安卓手机上显示正常

参考文档 https://hexo.fluid-dev.com/docs/guide/#latex-%E6%95%B0%E5%AD%A6%E5%85%AC%E5%BC%8F 卸载了 npm uninstall hexo-renderer-marked --save

问题还是没有解决



我的 主页  www.zywvvd.com
访问这个页面 可以复现问题 https://www.zywvvd.com/notes/study/math/convex-func/convex-func/
感谢~
zywvvd commented 2 years ago

经过排查 我发现是公式 的懒加载 导致的问题,我在 math.ejs 文件中删掉

            loader : {
              ${ lazy ? 'load: \[\'ui/lazy\'\]' : '' }
            },

显示便正常了

如果想要屏蔽部分代码是否可以通过注入的方式 无侵入地修改

Enderfga commented 2 years ago

同样的问题 但是删除上面的代码没有成功解决;右键选择这个选项可以正常显示,但还是很不方便 svg

zywvvd commented 2 years ago

同样的问题 但是删除上面的代码没有成功解决;右键选择这个选项可以正常显示,但还是很不方便 svg

手机访问正常吗,我觉得如果手机端显示也有问题的话是渲染导致的,不然不是公式渲染的问题 1.8.14 之前的版本我的问题没有出现了,不知道你是不是和我一样的情况

Enderfga commented 2 years ago

目前我删除了你提到到math.ejs对应的部分,手机显示正常,pc端的效果也跟你上面图片一样

Enderfga commented 2 years ago

另外我想请问一下 要怎么回退版本呢 我不熟悉npm 不敢乱动

zywvvd commented 2 years ago

另外我想请问一下 要怎么回退版本呢 我不熟悉npm 不敢乱动

我也不会 npm 是 git checkout 直接改调整主题源码版本弄的

zkqiang commented 2 years ago

请参考 https://github.com/fluid-dev/hexo-theme-fluid/issues/749#issuecomment-1135296099 看是否能解决问题

zywvvd commented 2 years ago

我确实用的是 mathjax 3.2.1, 该问题关闭懒加载后解决了 通过删除代码的方式,不知道有没有优雅的注入方式实现 当前问题关闭了