Skip to content

Commit c42e88b

Browse files
author
Jason Ward
committed
refs #25: added a test showing that smart tags in a list work fine.
1 parent 62851bb commit c42e88b

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
@@ -767,6 +767,31 @@ def get_xml(self):
767767
return xml
768768

769769

770+
class SmartTagInList(_TranslationTestCase):
771+
expected_output = '''
772+
<html><body>
773+
<ol data-list-type="decimal">
774+
<li>AAA<br/>
775+
BBB
776+
</li>
777+
<li>CCC</li>
778+
</ol>
779+
</body></html>
780+
'''
781+
782+
def get_xml(self):
783+
run_tags = [DXB.r_tag(i) for i in 'BBB']
784+
smart_tag = DXB.smart_tag(run_tags)
785+
p_tag = DXB.p_tag([smart_tag])
786+
787+
body = DXB.li(text='AAA', ilvl=0, numId=0)
788+
body += p_tag
789+
body += DXB.li(text='CCC', ilvl=0, numId=0)
790+
791+
xml = DXB.xml(body)
792+
return xml
793+
794+
770795
class SingleListItem(_TranslationTestCase):
771796
expected_output = '''
772797
<html><body>

0 commit comments

Comments
 (0)