Conversion: When specifying a line-height dont apply it to the <html> tag, as it is pointless and causes the execrable epubcheck to complain. Fixes #1922570 [EPub from ebook-convert is accepted by Amazon KDP, but not Google Play](https://bugs.launchpad.net/calibre/+bug/1922570)

This commit is contained in:
Kovid Goyal 2021-04-06 09:36:31 +05:30
parent f6e55966f5
commit ac68f4550c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -489,7 +489,7 @@ class CSSFlattener(object):
cssdict[x] = popval cssdict[x] = popval
if cssdict: if cssdict:
if self.lineh and self.fbase and tag != 'body': if self.lineh and self.fbase and tag not in ('body', 'html'):
self.clean_edges(cssdict, style, psize) self.clean_edges(cssdict, style, psize)
if 'display' in cssdict and cssdict['display'] == 'in-line': if 'display' in cssdict and cssdict['display'] == 'in-line':
cssdict['display'] = 'inline' cssdict['display'] = 'inline'
@ -506,7 +506,7 @@ class CSSFlattener(object):
if 'vertical-align' in cssdict \ if 'vertical-align' in cssdict \
and cssdict['vertical-align'] == 'sup': and cssdict['vertical-align'] == 'sup':
cssdict['vertical-align'] = 'super' cssdict['vertical-align'] = 'super'
if self.lineh and 'line-height' not in cssdict: if self.lineh and 'line-height' not in cssdict and tag != 'html':
lineh = self.lineh / psize lineh = self.lineh / psize
cssdict['line-height'] = "%0.5fem" % lineh cssdict['line-height'] = "%0.5fem" % lineh