mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-24 06:56:13 +01: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
1 changed files with 6 additions and 1 deletions
|
|
@ -845,7 +845,12 @@ def get_id(chapter, counter, prefix='calibre_css_'):
|
|||
except:
|
||||
size = '3'
|
||||
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:
|
||||
setting = 'font-size: %d%%;'%int((float(size)/3) * 100)
|
||||
except ValueError:
|
||||
|
|
|
|||
Loading…
Reference in a new issue