Skip to content

Commit

Permalink
Avoid empty "raw" directive
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Jan 2, 2022
1 parent 451de0e commit 3c6c6b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/nbsphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,12 @@
{{ output.data[datatype] | escape_latex | ansi2latex | indent | indent }}
\\end{sphinxVerbatim}
{# NB: The "raw" directive doesn't work with empty content #}
{%- if output.data[datatype].strip() %}
.. raw:: text
{{ output.data[datatype] | indent | indent }}
{%- endif %}
{%- elif datatype in ['image/svg+xml', 'image/png', 'image/jpeg', 'application/pdf'] %}
Expand Down

0 comments on commit 3c6c6b9

Please sign in to comment.