Handle quoted URLs in <a href=...> elements. Fix #34.

This commit is contained in:
Kovid Goyal 2007-04-30 19:48:59 +00:00
parent 0df0475b05
commit 8775a98191
2 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ You may have to adjust the GROUP and the location of the rules file to
suit your distribution. suit your distribution.
""" """
__version__ = "0.3.15" __version__ = "0.3.16"
__docformat__ = "epytext" __docformat__ = "epytext"
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>" __author__ = "Kovid Goyal <kovid@kovidgoyal.net>"

View File

@ -22,7 +22,7 @@ and to Falstaff for pylrs.
""" """
import os, re, sys, shutil, traceback import os, re, sys, shutil, traceback
from htmlentitydefs import name2codepoint from htmlentitydefs import name2codepoint
from urllib import urlopen from urllib import urlopen, unquote
from urlparse import urlparse from urlparse import urlparse
from tempfile import mkdtemp from tempfile import mkdtemp
from operator import itemgetter from operator import itemgetter
@ -397,7 +397,7 @@ class HTMLConverter(object):
purl = urlparse(link.tag['href']) purl = urlparse(link.tag['href'])
if purl[1]: # Not a link to a file on the local filesystem if purl[1]: # Not a link to a file on the local filesystem
continue continue
path, fragment = purl[2], purl[5] path, fragment = unquote(purl[2]), purl[5]
para, tag = link.para, link.tag para, tag = link.para, link.tag
if not path or os.path.basename(path) == self.file_name: if not path or os.path.basename(path) == self.file_name:
if fragment in self.targets.keys(): if fragment in self.targets.keys():