EPUB Output: Fix play order in generated NCX being uniformly zero when the input HTML file has a name with special characters. Fixes #4397 (Play order)

This commit is contained in:
Kovid Goyal 2010-01-03 13:45:50 -07:00
parent 0450dcf435
commit 925b3ea1fc
2 changed files with 5 additions and 5 deletions

View File

@ -1806,7 +1806,7 @@ class OEBBook(object):
return {OPF_MIME: ('content.opf', package)}
def _update_playorder(self, ncx):
hrefs = set(xpath(ncx, '//ncx:content/@src'))
hrefs = set(map(urlnormalize, xpath(ncx, '//ncx:content/@src')))
playorder = {}
next = 1
selector = XPath('h:body//*[@id or @name]')
@ -1828,9 +1828,9 @@ class OEBBook(object):
if added:
next += 1
selector = XPath('ncx:content/@src')
for elem in xpath(ncx, '//*[@playOrder and ./ncx:content[@src]]'):
href = selector(elem)[0]
order = playorder.get(href, 0)
for i, elem in enumerate(xpath(ncx, '//*[@playOrder and ./ncx:content[@src]]')):
href = urlnormalize(selector(elem)[0])
order = playorder.get(href, i)
elem.attrib['playOrder'] = str(order)
return

View File

@ -86,7 +86,7 @@ At the moment |app| has full support for the SONY PRS 300/500/505/600/700/900, B
How can I help get my device supported in |app|?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If your device appears as a USB disk to the operating system. Adding support for it to |app| is very easy.
If your device appears as a USB disk to the operating system, adding support for it to |app| is very easy.
We just need some information from you:
* What e-book formats does your device support?