DOCX Output: Fix a comment immediately after a <li> tag breaking the conversion

This commit is contained in:
Kovid Goyal 2022-03-24 21:02:00 +05:30
parent 2c8e5a3a36
commit 3df6200ca7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -586,7 +586,7 @@ class Convert:
else:
text = html_tag.text
is_list_item = tagname == 'li'
has_sublist = is_list_item and len(html_tag) and barename(html_tag[0].tag) in ('ul', 'ol') and len(html_tag[0])
has_sublist = is_list_item and len(html_tag) and isinstance(html_tag[0].tag, str) and barename(html_tag[0].tag) in ('ul', 'ol') and len(html_tag[0])
if text and has_sublist and not text.strip():
text = '' # whitespace only, ignore
if text: