mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MOBI Input: Don't error out when detecting TOC structure if one of the elements has an invalid margin unit
This commit is contained in:
parent
997a943257
commit
010b2e8081
@ -690,6 +690,14 @@ class MobiReader(object):
|
|||||||
lm = unit_convert('2em', 12, 500, 166)
|
lm = unit_convert('2em', 12, 500, 166)
|
||||||
lm = self.left_margins.get(tag, lm)
|
lm = self.left_margins.get(tag, lm)
|
||||||
ti = self.text_indents.get(tag, ti)
|
ti = self.text_indents.get(tag, ti)
|
||||||
|
try:
|
||||||
|
lm = float(lm)
|
||||||
|
except:
|
||||||
|
lm = 0.0
|
||||||
|
try:
|
||||||
|
ti = float(ti)
|
||||||
|
except:
|
||||||
|
ti = 0.0
|
||||||
return lm + ti
|
return lm + ti
|
||||||
|
|
||||||
parent = tag
|
parent = tag
|
||||||
|
Loading…
x
Reference in New Issue
Block a user