mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
dc02dbcc8e
commit
b70a8d5aa9
@ -474,7 +474,7 @@ def strftime(fmt, t=None):
|
||||
def my_unichr(num):
|
||||
try:
|
||||
return unichr(num)
|
||||
except ValueError:
|
||||
except (ValueError, OverflowError):
|
||||
return u'?'
|
||||
|
||||
def entity_to_unicode(match, exceptions=[], encoding='cp1252',
|
||||
|
@ -172,6 +172,9 @@ class Serializer(object):
|
||||
hrefs = self.oeb.manifest.hrefs
|
||||
buffer.write('<guide>')
|
||||
for ref in self.oeb.guide.values():
|
||||
# The Kindle decides where to open a book based on the presence of
|
||||
# an item in the guide that looks like
|
||||
# <reference type="text" title="Start" href="chapter-one.xhtml"/>
|
||||
path = urldefrag(ref.href)[0]
|
||||
if path not in hrefs or hrefs[path].media_type not in OEB_DOCS:
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user