From 2282a97a413524354616a22cbbba2c8e20a36ae9 2014-05-08 03:16:42 From: chebee7i Date: 2014-05-08 03:16:42 Subject: [PATCH] Add output to IPython directive when in verbatim mode. Addresses #5776. --- diff --git a/IPython/sphinxext/ipython_directive.py b/IPython/sphinxext/ipython_directive.py index ef99a89..8486661 100644 --- a/IPython/sphinxext/ipython_directive.py +++ b/IPython/sphinxext/ipython_directive.py @@ -542,6 +542,16 @@ class EmbeddedSphinxShell(object): else: self.custom_doctest(decorator, input_lines, found, submitted) + # Make sure output is processed when in verbatim mode. + # https://github.com/ipython/ipython/issues/5776 + is_verbatim = decorator=='@verbatim' or self.is_verbatim + if is_verbatim: + out_data = data + else: + out_data = None + + return out_data + def process_comment(self, data): """Process data fPblock for COMMENT token.""" if not self.is_suppress: