Fix mathjax

This commit is contained in:
cuom1999 2022-08-08 18:05:44 +07:00
parent 644d640682
commit 04b9849b40

View file

@ -12,7 +12,7 @@ mistune._pre_tags.append("latex")
class MathInlineGrammar(mistune.InlineGrammar): class MathInlineGrammar(mistune.InlineGrammar):
block_math = re.compile(r"^\$\$(.*?)\$\$|^\\\[(.*?)\\\]", re.DOTALL) block_math = re.compile(r"^\$\$(.*?)\$\$|^\\\[(.*?)\\\]", re.DOTALL)
math = re.compile(r"^~(.*?)~|^\$(.*?)\$|^\\\((.*?)\\\)", re.DOTALL) math = re.compile(r"^~(.*?)~|^\$(.*?)\$|^\\\((.*?)\\\)", re.DOTALL)
# text = re.compile(r"^[\s\S]+?(?=[\\<!\[_*`$]|\\[\[(]|https?://| {2,}\n|$)") text = re.compile(r"^[\s\S]+?(?=[\\<!\[_*`$~]|\\[\[(]|https?://| {2,}\n|$)")
class MathInlineLexer(mistune.InlineLexer): class MathInlineLexer(mistune.InlineLexer):