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

KaTeX公式中的大括号(\left \{ \right \})无法正常渲染 #778

Open
HC3560 opened this issue Jan 6, 2025 · 1 comment
Open

Comments

@HC3560
Copy link

HC3560 commented Jan 6, 2025

突然发现Twikoo评论中的大括号无法正常渲染,报错:ParseEror: KaTeX parse error: Expected '}' got '\right' at position 13: \left { 123 \right }

复现:

在任意Twikoo评论框中输入\left \{ \right \},报语法错误,无法正常渲染。

例如,使用中括号\left [ \right ]作为对比,在官网 https://twikoo.js.org/ 的评论框中输入:

$$\left \{ 123 \right \}$$
$$\left [ 123 \right ]$$

点击预览后得到:

1

同样的代码在KaTeX官网 https://katex.org/ 中可以正常显示:

2

使用基于KaTeX渲染公式的Hexo博客测试了一下,同样可以正常渲染与显示。

Twikoo很好用,感谢开发!!!

@HC3560
Copy link
Author

HC3560 commented Jan 6, 2025

又突然发现评论中输入大括号时使用\\{ \\}即可正常显示:

3

可能是大括号使用官方的\left \{ \right \}时有字符冲突什么的,不好实现嘛?如果想使用官方版本的代码的话应该如何配置呢

但空行好像有点小问题?两行公式之间行间距有点大。在两个行间公式中加一个空行两个公式就可以挨在一起了:

4

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

No branches or pull requests

1 participant