Skip to content

Commit ff7f6da

Browse files
committed
Account for empty content in caption
This is mainly to preserve test integrity
1 parent 07da4ad commit ff7f6da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pymdownx/blocks/caption.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ def update_tag(el, fig_type, fig_num, template, prepend):
5959
p = children[0]
6060
span = etree.Element('span', {'class': 'caption-prefix'})
6161
span.text = value
62-
span.tail = (' ' + p.text) if p.text is not None else p.text
62+
empty = not bool(p.text)
63+
span.tail = (' ' + p.text) if not empty else p.text
6364
p.text = None
6465
p.insert(0, span)
6566

0 commit comments

Comments
 (0)