Skip to content

Commit

Permalink
Replace leading/trailing empty code lines with <br/>
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Dec 4, 2021
1 parent 44829f1 commit 4030600
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nbsphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -2133,9 +2133,9 @@ def depart_codearea_html(self, node):
"""Add empty lines before and after the code."""
text = self.body[-1]
text = text.replace('<pre>',
'<pre>\n' + '\n' * node.get('empty-lines-before', 0))
'<pre>' + '<br/>' * node.get('empty-lines-before', 0))
text = text.replace('</pre>',
'\n' * node.get('empty-lines-after', 0) + '</pre>')
'<br/>' * node.get('empty-lines-after', 0) + '</pre>')
self.body[-1] = text


Expand Down

0 comments on commit 4030600

Please sign in to comment.