mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle quoted URLs in <a href=...> elements. Fix #34.
This commit is contained in:
parent
0df0475b05
commit
8775a98191
@ -33,7 +33,7 @@ You may have to adjust the GROUP and the location of the rules file to
|
||||
suit your distribution.
|
||||
"""
|
||||
|
||||
__version__ = "0.3.15"
|
||||
__version__ = "0.3.16"
|
||||
__docformat__ = "epytext"
|
||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||
|
||||
|
@ -22,7 +22,7 @@ and to Falstaff for pylrs.
|
||||
"""
|
||||
import os, re, sys, shutil, traceback
|
||||
from htmlentitydefs import name2codepoint
|
||||
from urllib import urlopen
|
||||
from urllib import urlopen, unquote
|
||||
from urlparse import urlparse
|
||||
from tempfile import mkdtemp
|
||||
from operator import itemgetter
|
||||
@ -397,7 +397,7 @@ class HTMLConverter(object):
|
||||
purl = urlparse(link.tag['href'])
|
||||
if purl[1]: # Not a link to a file on the local filesystem
|
||||
continue
|
||||
path, fragment = purl[2], purl[5]
|
||||
path, fragment = unquote(purl[2]), purl[5]
|
||||
para, tag = link.para, link.tag
|
||||
if not path or os.path.basename(path) == self.file_name:
|
||||
if fragment in self.targets.keys():
|
||||
|
Loading…
x
Reference in New Issue
Block a user