mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
EPUB: Handle files in the EPUB that have semi-colons in their file names. This means in particular using URL escaping when creating the NCX as ADE cannot handle unescaped semi-colons in the NCX. See #1033665
This commit is contained in:
parent
aab1e91f50
commit
89c0ad4cca
@ -196,8 +196,8 @@ class TOC(list):
|
||||
content = content[0]
|
||||
src = get_attr(content, attr='src')
|
||||
if src:
|
||||
purl = urlparse(unquote(content.get('src')))
|
||||
href, fragment = purl[2], purl[5]
|
||||
purl = urlparse(content.get('src'))
|
||||
href, fragment = unquote(purl[2]), unquote(purl[5])
|
||||
nd = dest.add_item(href, fragment, text)
|
||||
nd.play_order = play_order
|
||||
|
||||
|
@ -1541,7 +1541,7 @@ class TOC(object):
|
||||
if title:
|
||||
title = re.sub(r'\s+', ' ', title)
|
||||
element(label, NCX('text')).text = title
|
||||
element(point, NCX('content'), src=urlunquote(node.href))
|
||||
element(point, NCX('content'), src=node.href)
|
||||
node.to_ncx(point)
|
||||
return parent
|
||||
|
||||
|
@ -577,7 +577,7 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
|
||||
if not os.path.exists(item.abspath):
|
||||
return error_dialog(self, _('No such location'),
|
||||
_('The location pointed to by this item'
|
||||
' does not exist.'), show=True)
|
||||
' does not exist.'), det_msg=item.abspath, show=True)
|
||||
url = QUrl.fromLocalFile(item.abspath)
|
||||
if item.fragment:
|
||||
url.setFragment(item.fragment)
|
||||
|
Loading…
x
Reference in New Issue
Block a user