mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
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:
parent
f6e55966f5
commit
ac68f4550c
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user