DOCX Output: Ignore invalid text-indent values in the input document instead of erroring out. Fixes #1618869 [EPUB to DOCX conversion fails](https://bugs.launchpad.net/calibre/+bug/1618869)

This commit is contained in:
Kovid Goyal 2016-08-31 20:01:57 +05:30
parent 0f0ba7af23
commit d6c3a1b1e1

View File

@ -485,8 +485,12 @@ class BlockStyle(DOCXStyle):
self.background_color = None
self.text_align = 'left'
else:
self.text_indent = int(css['text-indent'] * 20)
self.css_text_indent = css._get('text-indent')
try:
self.text_indent = int(css['text-indent'] * 20)
self.css_text_indent = css._get('text-indent')
except (TypeError, ValueError):
self.text_indent = 0
self.css_text_indent = None
try:
self.line_height = max(0, int(css.lineHeight * 20))
except (TypeError, ValueError):