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)

This commit is contained in:
Kovid Goyal 2014-08-25 09:14:56 +05:30
parent 8ffd0215ef
commit bd55c5e1e2

View File

@ -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')]: