mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DOCX Output: Fix internal links not working when converted files contain URL unsafe characters in their filenames
This commit is contained in:
parent
63eea9fa35
commit
4b7e24ec46
@ -8,6 +8,7 @@ __copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
|||||||
import posixpath, re
|
import posixpath, re
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
|
from calibre.ebooks.oeb.base import urlquote
|
||||||
from calibre.utils.filenames import ascii_text
|
from calibre.utils.filenames import ascii_text
|
||||||
from polyglot.builtins import unicode_type
|
from polyglot.builtins import unicode_type
|
||||||
from polyglot.urllib import urlparse
|
from polyglot.urllib import urlparse
|
||||||
@ -118,6 +119,8 @@ class LinksManager(object):
|
|||||||
|
|
||||||
if not purl.scheme:
|
if not purl.scheme:
|
||||||
href = item.abshref(href)
|
href = item.abshref(href)
|
||||||
|
if href not in self.document_hrefs:
|
||||||
|
href = urlquote(href)
|
||||||
if href in self.document_hrefs:
|
if href in self.document_hrefs:
|
||||||
key = (href, purl.fragment or self.top_anchor)
|
key = (href, purl.fragment or self.top_anchor)
|
||||||
if key in self.anchor_map:
|
if key in self.anchor_map:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user