From 2832ae1046eb6bf198c857bc0a6ed6a66943f3c7 2014-03-06 23:46:31 From: Jonathan Frederic Date: 2014-03-06 23:46:31 Subject: [PATCH] Fix blank cell collapsing. --- diff --git a/IPython/nbconvert/filters/highlight.py b/IPython/nbconvert/filters/highlight.py index 3cf6ff4..be03a22 100644 --- a/IPython/nbconvert/filters/highlight.py +++ b/IPython/nbconvert/filters/highlight.py @@ -56,7 +56,7 @@ class Highlight2Html(NbConvertBase): if not language: language=self.default_language - return _pygments_highlight(source, HtmlFormatter(), language, metadata) + return _pygments_highlight(source if len(source) > 0 else ' ', HtmlFormatter(), language, metadata) class Highlight2Latex(NbConvertBase):