This commit is contained in:
Kovid Goyal 2009-02-10 13:45:27 -08:00
parent 97a64f159f
commit 4fa00105b3

View File

@ -309,7 +309,10 @@ class MobiReader(object):
attrib['id'] = attrib.pop('filepos-id') attrib['id'] = attrib.pop('filepos-id')
if 'filepos' in attrib: if 'filepos' in attrib:
filepos = attrib.pop('filepos') filepos = attrib.pop('filepos')
attrib['href'] = "#filepos%s" % filepos try:
attrib['href'] = "#filepos%d" % int(filepos)
except ValueError:
attrib['href'] = filepos
if tag.tag == 'img': if tag.tag == 'img':
recindex = None recindex = None
for attr in self.IMAGE_ATTRS: for attr in self.IMAGE_ATTRS: