diff --git a/nbconvert/filters/markdown_mistune.py b/nbconvert/filters/markdown_mistune.py index abe70883d..280ae86ef 100644 --- a/nbconvert/filters/markdown_mistune.py +++ b/nbconvert/filters/markdown_mistune.py @@ -49,7 +49,7 @@ def parse_multiline_math(self, m): """Add token to pass through mutiline math.""" self.tokens.append({ "type": "multiline_math", - "text": m.string + "text": m.group(0) }) diff --git a/nbconvert/filters/tests/test_markdown.py b/nbconvert/filters/tests/test_markdown.py index 76fd8ca7a..a66d018dd 100644 --- a/nbconvert/filters/tests/test_markdown.py +++ b/nbconvert/filters/tests/test_markdown.py @@ -137,18 +137,18 @@ def test_markdown2html_math(self): "$$aa;a-b<0$$", "$$$$", - """$$x -= -2$$""", - r"""$$ - b_{l_1,l_2,l_3}^{\phi\phi\omega} = -8\, l_1\times l_2 \,l_1\cdot l_2 \int_0^{\chi_*} d\chi \frac{W(\chi,\chi_*)^2}{\chi^2} \int_0^{\chi}d\chi' \frac{W(\chi',\chi)W(\chi',\chi_*)}{{\chi'}^2} \left[ - P_\psi\left(\frac{l_1}{\chi},z(\chi)\right) P_\Psi\left(\frac{l_2}{\chi'},z(\chi')\right) -- (l_1\leftrightarrow l_2) -\right] -$$""", - r"""\begin{equation*} -x = 2 *55* 7 -\end{equation*}""", + ("$$x\\n" + "=\\n" + "2$$"), + ("$$\\n" + "b = \\left[\\n" + "P\\left(\\right)\\n" + "- (l_1\\leftrightarrow l_2\\n)" + "\\right]" + "$$"), + ("\\begin{equation*}\\n" + "x = 2 *55* 7" + "\\end{equation*}"), """$ \\begin{tabular}{ l c r } 1 & 2 & 3 \\