siyuan-note / siyuan

A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang.
https://b3log.org/siyuan
GNU Affero General Public License v3.0
21.85k stars 1.56k forks source link

发布到微信公众号支持公式渲染 #12571

Open Achuan-2 opened 1 month ago

Achuan-2 commented 1 month ago

In what scenarios do you need this feature?


行间公式

$$
\chi^2 = \sum \frac{(Observed - Expected)^2}{Expected}
$$

行内公式

$\chi^2 = \sum \frac{(Observed - Expected)^2}{Expected}$

思源笔记预览 PixPin_2024-09-24_12-17-00 发布到微信公众号,可以看到行内公式可以正常显示,行间公式却完全乱了 PixPin_2024-09-24_12-17-24

虽然行内公式看着没问题,而发布后,手机上查看,发现行内公式也是乱的 8901fc08fb3166d7fda1e610a98b488

Describe the optimal solution

发布微信公众号支持公式渲染

Describe the candidate solution

No response

Other information

No response

Achuan-2 commented 1 month ago

可参考:https://github.com/doocs/md/pull/385/files

Achuan-2 commented 2 weeks ago

https://github.com/doocs/md/blob/main/src/utils/MDKatex.js

由 MathJax 做渲染