From ac68f4550cd4b8135acada5f2b27571ef03f50fb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 6 Apr 2021 09:36:31 +0530 Subject: [PATCH] Conversion: When specifying a line-height dont apply it to the 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) --- src/calibre/ebooks/oeb/transforms/flatcss.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/oeb/transforms/flatcss.py b/src/calibre/ebooks/oeb/transforms/flatcss.py index b9b90cbd02..ee940f3ab3 100644 --- a/src/calibre/ebooks/oeb/transforms/flatcss.py +++ b/src/calibre/ebooks/oeb/transforms/flatcss.py @@ -489,7 +489,7 @@ class CSSFlattener(object): cssdict[x] = popval 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) if 'display' in cssdict and cssdict['display'] == 'in-line': cssdict['display'] = 'inline' @@ -506,7 +506,7 @@ class CSSFlattener(object): if 'vertical-align' in cssdict \ and cssdict['vertical-align'] == 'sup': 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 cssdict['line-height'] = "%0.5fem" % lineh