1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-01-26 07:05:45 +01:00

Removed urlunquote

This commit is contained in:
2020-07-11 16:24:16 +02:00
parent 5fb02998a1
commit c82c4e456c
7 changed files with 29 additions and 40 deletions

View File

@@ -5,6 +5,7 @@ import re
import posixpath
import traceback
import uuid
import urllib.parse
from lxml import etree
@@ -438,7 +439,8 @@ class EPUBInput(InputFormatPlugin):
href, frag = elem.get('href').partition('#')[::2]
link_path = (os.path
.relpath(os.path
.join(base_path, base.urlunquote(href)),
.join(base_path,
urllib.parse.unquote(href)),
base_path))
abs_href = base.urlnormalize(link_path)
if abs_href == self.removed_cover:

View File

@@ -4,7 +4,6 @@ import shutil
import urllib.parse
import uuid
from ebook_converter import constants as const
from ebook_converter.ebooks.oeb import base
from ebook_converter.ebooks.oeb import parse_utils
from ebook_converter.customize.conversion import OutputFormatPlugin
@@ -390,7 +389,7 @@ class EPUBOutput(OutputFormatPlugin):
href = getattr(node, 'href', None)
if hasattr(href, 'partition'):
_base, _, frag = href.partition('#')
frag = base.urlunquote(frag)
frag = urllib.parse.unquote(frag)
if frag and frag_pat.match(frag) is None:
self.log.warn(
'Removing fragment identifier %r from TOC as Adobe Digital Editions cannot handle it'%frag)