From bd55c5e1e259fc022917e28254252bf43d0a9ded Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 25 Aug 2014 09:14:56 +0530 Subject: [PATCH] Conversion: Fix error when converting EPUB/HTML files that contain invalid margin or padding declarations. Fixes #1360842 [ePub to PDF convertion failed](https://bugs.launchpad.net/calibre/+bug/1360842) --- src/calibre/ebooks/oeb/normalize_css.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/normalize_css.py b/src/calibre/ebooks/oeb/normalize_css.py index 8d135fde1a..944f63cf7d 100644 --- a/src/calibre/ebooks/oeb/normalize_css.py +++ b/src/calibre/ebooks/oeb/normalize_css.py @@ -206,7 +206,7 @@ def normalize_filter_css(props): def condense_edge(vals): edges = {x.name.rpartition('-')[-1]:x.value for x in vals} - if len(edges) != 4: + if len(edges) != 4 or set(edges) != {'left', 'top', 'right', 'bottom'}: return ce = {} for (x, y) in [('left', 'right'), ('top', 'bottom')]: