mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 09:03:07 +02:00
EPUB Output: Fix splitting breaking internal links in the epub, if the links pointed to files with URL unsafe characters in their file names. Fixes #929966 (HTML links break when converting epub to epub)
This commit is contained in:
parent
ea0432d3fe
commit
24e4e1cf00
1 changed files with 3 additions and 2 deletions
|
|
@ -15,8 +15,8 @@
|
|||
from lxml import etree
|
||||
from lxml.cssselect import CSSSelector
|
||||
|
||||
from calibre.ebooks.oeb.base import OEB_STYLES, XPNSMAP as NAMESPACES, \
|
||||
urldefrag, rewrite_links, urlunquote, barename, XHTML
|
||||
from calibre.ebooks.oeb.base import (OEB_STYLES, XPNSMAP as NAMESPACES,
|
||||
urldefrag, rewrite_links, urlunquote, barename, XHTML, urlnormalize)
|
||||
from calibre.ebooks.epub import rules
|
||||
|
||||
XPath = functools.partial(_XPath, namespaces=NAMESPACES)
|
||||
|
|
@ -159,6 +159,7 @@ def rewrite_links(self, url):
|
|||
except ValueError:
|
||||
# Unparseable URL
|
||||
return url
|
||||
href = urlnormalize(href)
|
||||
if href in self.map:
|
||||
anchor_map = self.map[href]
|
||||
nhref = anchor_map[frag if frag else None]
|
||||
|
|
|
|||
Loading…
Reference in a new issue