Relax more markdown

This commit is contained in:
cuom1999 2022-08-01 15:01:19 +07:00
parent 7f2e3f2594
commit db096c83f8

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):