请问,我使用react-katex组件的时候,发现如果字符串中包含中文的时候,就会报错
zuwensong opened this issue · comments
@zuwensong , according to KaTeX/KaTeX#380, katex should support CJK characters.
Apparently there are still some issues. react-katex
is just passing the string down to katex library. It's not responsible for parsing.
Have you tried to wrap your text into \text{}
?
<BlockMath math={'\\text{你好}'} />
你好,请问解决了吗?我也想实现类似的功能
@chuxusave , I don't think so. I've mentioned workaround in my previous comment. Have you tried it?
@zuwensong , according to KaTeX/KaTeX#380, katex should support CJK characters.
Apparently there are still some issues.
react-katex
is just passing the string down to katex library. It's not responsible for parsing.Have you tried to wrap your text into
\text{}
?<BlockMath math={'\\text{你好}'} />
Wonderful! This is the answer! Works like a charm!