unicode fixes

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1861 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2004-10-25 21:24:11 +00:00
parent ddf49edefc
commit 5f0660d1f4

View file

@ -141,20 +141,21 @@ class LinkFinder (TagFinder):
if attr in attrs:
# name of this link
if tag == 'a' and attr == 'href':
name = linkcheck.strformat.unquote(attrs.get('title', ''))
name = linkcheck.strformat.unquote(
attrs.get('title', u''))
if not name:
name = linkcheck.linkname.href_name(
self.content[self.parser.pos():])
elif tag == 'img':
name = linkcheck.strformat.unquote(attrs.get('alt', ''))
name = linkcheck.strformat.unquote(attrs.get('alt', u''))
if not name:
name = linkcheck.strformat.unquote(
attrs.get('title', ''))
attrs.get('title', u''))
else:
name = ""
name = u""
# possible codebase
if tag in ('applet', 'object'):
base = linkcheck.strformat.unquote(attrs.get('codebase'))
base = linkcheck.strformat.unquote(attrs.get('codebase', ''))
else:
base = ""
value = linkcheck.strformat.unquote(attrs[attr])