From 70779d9ff4648b6ce85d7f9e23d15ba6eaee5ffa Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 22 Feb 2014 08:07:08 +0530 Subject: [PATCH] Conversion: Fix incorrect CSS being generated when converting files that have tags with width or height attributes that contain fractional numbers. Fixes #1283108 [Private bug](https://bugs.launchpad.net/calibre/+bug/1283108) --- src/calibre/ebooks/oeb/stylizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index f9a199042c..c720f65c01 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -315,7 +315,7 @@ class Stylizer(object): self.style(elem)._update_cssdict(cssdict) for elem in xpath(tree, '//h:*[@style]'): self.style(elem)._apply_style_attr(url_replacer=item.abshref) - num_pat = re.compile(r'\d+$') + num_pat = re.compile(r'[0-9.]$') for elem in xpath(tree, '//h:img[@width or @height]'): style = self.style(elem) # Check if either height or width is not default