DOCX Input: Avoid using the value attribute for simple numbered lists

This commit is contained in:
Kovid Goyal 2013-10-04 20:44:42 +05:30
parent 4f87c0d39e
commit 1999622f44

View File

@ -298,7 +298,7 @@ class Numbering(object):
for attr in ('list-lvl', 'list-id', 'list-template'):
child.attrib.pop(attr, None)
val = int(child.get('value'))
if last_val == val - 1 or wrap.tag == 'ul':
if last_val == val - 1 or wrap.tag == 'ul' or (last_val is None and val == 1):
child.attrib.pop('value')
last_val = val
current_run[-1].tail = '\n'