Skip to content

Commit

Permalink
fix for an issue with empty math block
Browse files Browse the repository at this point in the history
  • Loading branch information
pacahon committed Jan 9, 2018
1 parent 8984d4d commit 4f23786
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions nbconvert/exporters/tests/files/notebook2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@
"\n",
"one *test* two *tests*. three *tests*"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Make sure markdown parser doesn't crash with empty Latex formulas blocks\n$$$$\n$$"
]
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion nbconvert/filters/markdown_mistune.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def output_inline_math(self, m):
return self.renderer.inline_math(m.group(1) or m.group(2))

def output_block_math(self, m):
return self.renderer.block_math(m.group(1) or m.group(2))
return self.renderer.block_math(m.group(1) or m.group(2) or "")

def output_latex_environment(self, m):
return self.renderer.latex_environment(m.group(1),
Expand Down

0 comments on commit 4f23786

Please sign in to comment.