DOCX Output: Workaround for broken CSS that uses -o-pre-wrap for the white-space property

See #1786410 (book lost its content format when converting)
This commit is contained in:
Kovid Goyal 2018-08-30 09:25:36 +05:30
parent 30b1f442a6
commit 2447be653b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -169,7 +169,7 @@ class Block(object):
def add_text(self, text, style, ignore_leading_whitespace=False, html_parent=None, is_parent_style=False, bookmark=None, link=None, lang=None):
ws = style['white-space']
preserve_whitespace = ws in {'pre', 'pre-wrap'}
preserve_whitespace = ws in {'pre', 'pre-wrap', '-o-pre-wrap'}
ts = self.styles_manager.create_text_style(style, is_parent_style=is_parent_style)
if self.runs and ts == self.runs[-1].style and link == self.runs[-1].link and lang == self.runs[-1].lang:
run = self.runs[-1]