Skip to content

Commit 28184d2

Browse files
committed
Avoid empty "raw" directive
1 parent 2daadec commit 28184d2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/nbsphinx.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,12 @@
162162
{{ output.data[datatype] | escape_latex | ansi2latex | indent | indent }}
163163
\\end{sphinxVerbatim}
164164
165+
{# NB: The "raw" directive doesn't work with empty content #}
166+
{%- if output.data[datatype].strip() %}
165167
.. raw:: text
166168
167169
{{ output.data[datatype] | indent | indent }}
170+
{%- endif %}
168171
169172
{%- elif datatype in ['image/svg+xml', 'image/png', 'image/jpeg', 'application/pdf'] %}
170173

0 commit comments

Comments
 (0)