mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix #1977 (Error on converting zip with html to ePUB u'invalid literal for float(): +2)
This commit is contained in:
parent
3eb0f3fff1
commit
73af726c71
@ -845,7 +845,12 @@ class Processor(Parser):
|
|||||||
except:
|
except:
|
||||||
size = '3'
|
size = '3'
|
||||||
if size and size.strip() and size.strip()[0] in ('+', '-'):
|
if size and size.strip() and size.strip()[0] in ('+', '-'):
|
||||||
size = 3 + float(size) # Hack assumes basefont=3
|
size = re.search(r'[+-]{0,1}[\d\.]+', size)
|
||||||
|
try:
|
||||||
|
size = float(size.group())
|
||||||
|
except:
|
||||||
|
size = 0
|
||||||
|
size += 3 # Hack assumes basefont=3
|
||||||
try:
|
try:
|
||||||
setting = 'font-size: %d%%;'%int((float(size)/3) * 100)
|
setting = 'font-size: %d%%;'%int((float(size)/3) * 100)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user