File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -331,28 +331,30 @@ def parse_element_content(self, element: etree.Element) -> None:
331
331
# Replace the placeholder with the element and process it.
332
332
# Content after the placeholder should be attached to the tail.
333
333
if child is None :
334
- element .text = block [start :end ]
334
+ element .text + = block [start :end ]
335
335
else :
336
- child .tail = f" { child . tail if child . tail is not None else '' } { block [start :end ]} "
336
+ child .tail += block [start :end ]
337
337
element .append (el )
338
338
self .parse_element_content (el )
339
339
child = el
340
+ if child .tail is None :
341
+ child .tail = ''
340
342
self .parser .md .htmlStash .rawHtmlBlocks .pop (index )
341
343
self .parser .md .htmlStash .rawHtmlBlocks .insert (index , '' )
342
344
343
345
else :
344
346
# Not an element object, so insert content back into the element
345
347
if child is None :
346
- element .text = block [start :end ]
348
+ element .text + = block [start :end ]
347
349
else :
348
- child .tail = f" { child . tail if child . tail is not None else '' } { block [start :end ]} "
350
+ child .tail += block [start :end ]
349
351
start = end
350
352
351
353
# Insert anything left after last element
352
354
if child is None :
353
- element .text = block [start :]
355
+ element .text + = block [start :]
354
356
else :
355
- child .tail = ( child . tail if child . tail is not None else '' ) + block [start :]
357
+ child .tail += block [start :]
356
358
357
359
else :
358
360
# Disable inline parsing for everything else
You can’t perform that action at this time.
0 commit comments