Skip to content

Commit d960fc3

Browse files
author
Jason Ward
committed
refs #25: added a test showing that inserted text in lists is still broken
1 parent f1730a3 commit d960fc3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

pydocx/tests/test_xml.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,31 @@ def get_xml(self):
742742
return xml
743743

744744

745+
class InsertTagInList(_TranslationTestCase):
746+
expected_output = '''
747+
<html><body>
748+
<ol data-list-type="decimal">
749+
<li>AAA<br/>
750+
<span class='insert' author='' date=''>BBB</span>
751+
</li>
752+
<li>CCC</li>
753+
</ol>
754+
</body></html>
755+
'''
756+
757+
def get_xml(self):
758+
run_tags = [DXB.r_tag(i) for i in 'BBB']
759+
insert_tags = DXB.insert_tag(run_tags)
760+
p_tag = DXB.p_tag([insert_tags])
761+
762+
body = DXB.li(text='AAA', ilvl=0, numId=0)
763+
body += p_tag
764+
body += DXB.li(text='CCC', ilvl=0, numId=0)
765+
766+
xml = DXB.xml(body)
767+
return xml
768+
769+
745770
class SingleListItem(_TranslationTestCase):
746771
expected_output = '''
747772
<html><body>

0 commit comments

Comments
 (0)