Skip to content

Commit c7f59c9

Browse files
committed
Fix tail newline handling
1 parent 0702ec8 commit c7f59c9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

markdown/extensions/md_in_html.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,9 @@ def handle_endtag(self, tag):
179179
child.tail = None
180180
state = child.attrib.get('markdown', 'off')
181181

182-
# If the tail is just a new line, omit it.
183-
tail = '' if tail == '\n' else '\n' + tail
182+
# Add a newline to tail if it is not just a trailing newline
183+
if tail != '\n':
184+
tail = '\n' + tail
184185

185186
# Process the block nested under the span appropriately
186187
if state in ('span', 'block'):

0 commit comments

Comments
 (0)