From 1999622f4408f6013d3a6b22fffc9b4552e2ff4a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 4 Oct 2013 20:44:42 +0530 Subject: [PATCH] DOCX Input: Avoid using the value attribute for simple numbered lists --- src/calibre/ebooks/docx/numbering.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/docx/numbering.py b/src/calibre/ebooks/docx/numbering.py index 740674d0dd..df500ee65c 100644 --- a/src/calibre/ebooks/docx/numbering.py +++ b/src/calibre/ebooks/docx/numbering.py @@ -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'