From 73b93fe7d89303020f8f7496f696a292976c3220 2015-03-17 22:23:23 From: Nicholas Bollweg Date: 2015-03-17 22:23:23 Subject: [PATCH] adding inline-block math --- diff --git a/IPython/nbconvert/filters/markdown_mistune.py b/IPython/nbconvert/filters/markdown_mistune.py index 1ff83b6..e97c3b1 100644 --- a/IPython/nbconvert/filters/markdown_mistune.py +++ b/IPython/nbconvert/filters/markdown_mistune.py @@ -23,7 +23,7 @@ from IPython.utils.decorators import undoc @undoc class MathBlockGrammar(mistune.BlockGrammar): - block_math = re.compile("^\$\$([^\$]*?)\$\$", re.DOTALL) + block_math = re.compile(r"^\$\$(.*?)\$\$", re.DOTALL) latex_environment = re.compile(r"^\\begin\{([a-z]*\*?)\}(.*?)\\end\{\1\}", re.DOTALL) @@ -52,12 +52,13 @@ class MathBlockLexer(mistune.BlockLexer): @undoc class MathInlineGrammar(mistune.InlineGrammar): - math = re.compile("^\$([^\$]+?)\$") + math = re.compile(r"^\$(.+?)\$") + block_math = re.compile(r"^\$\$(.+?)\$\$", re.DOTALL) text = re.compile(r'^[\s\S]+?(?=[\\