diff --git a/src/calibre/ebooks/conversion/plumber.py b/src/calibre/ebooks/conversion/plumber.py index e64b901688..8c5a99b64e 100644 --- a/src/calibre/ebooks/conversion/plumber.py +++ b/src/calibre/ebooks/conversion/plumber.py @@ -1103,10 +1103,14 @@ OptionRecommendation(name='search_replace', from calibre.ebooks.oeb.transforms.unsmarten import UnsmartenPunctuation UnsmartenPunctuation()(self.oeb, self.opts) + mobi_file_type = getattr(self.opts, 'mobi_file_type', 'old') + needs_old_markup = (self.output_plugin.file_type == 'lit' or + (self.output_plugin.file_type == 'mobi' and mobi_file_type + == 'old')) flattener = CSSFlattener(fbase=fbase, fkey=fkey, lineh=line_height, - untable=self.output_plugin.file_type in ('mobi','lit'), - unfloat=self.output_plugin.file_type in ('mobi', 'lit'), + untable=needs_old_markup, + unfloat=needs_old_markup, page_break_on_body=self.output_plugin.file_type in ('mobi', 'lit'), specializer=partial(self.output_plugin.specialize_css_for_output, diff --git a/src/calibre/ebooks/mobi/mobiml.py b/src/calibre/ebooks/mobi/mobiml.py index d276689224..f61dca0617 100644 --- a/src/calibre/ebooks/mobi/mobiml.py +++ b/src/calibre/ebooks/mobi/mobiml.py @@ -322,6 +322,10 @@ class MobiMLizer(object): istates.append(istate) left = 0 display = style['display'] + if display == 'table-cell': + display = 'inline' + elif display.startswith('table'): + display = 'block' isblock = (not display.startswith('inline') and style['display'] != 'none') isblock = isblock and style['float'] == 'none'