From e9eaee4969767cdb1359700ca6c4c0df7eed8a07 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 28 Jul 2009 14:12:52 -0600 Subject: [PATCH] Handle badly malformed font sizes in CSS --- src/calibre/ebooks/oeb/stylizer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index 18c16e44d5..9a52709ca4 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -411,6 +411,8 @@ class Style(object): result = size else: result = self._unit_convert(value, base=base, font=base) + if not isinstance(result, (int, float, long)): + return base if result < 0: result = normalize_fontsize("smaller", base) if factor: