mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2644 (KeyError: 0)
This commit is contained in:
parent
f7542137d3
commit
825045db71
@ -205,7 +205,12 @@ class CSSFlattener(object):
|
|||||||
fnums = self.context.source.fnums
|
fnums = self.context.source.fnums
|
||||||
if size[0] in ('+', '-'):
|
if size[0] in ('+', '-'):
|
||||||
# Oh, the warcrimes
|
# Oh, the warcrimes
|
||||||
cssdict['font-size'] = fnums[3+int(size)]
|
esize = 3 + int(size)
|
||||||
|
if esize < 1:
|
||||||
|
esize = 1
|
||||||
|
if esize > 7:
|
||||||
|
esize = 7
|
||||||
|
cssdict['font-size'] = fnums[esize]
|
||||||
else:
|
else:
|
||||||
cssdict['font-size'] = fnums[int(size)]
|
cssdict['font-size'] = fnums[int(size)]
|
||||||
del node.attrib['size']
|
del node.attrib['size']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user