mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
30b1f442a6
commit
2447be653b
@ -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):
|
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']
|
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)
|
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:
|
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]
|
run = self.runs[-1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user