mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-02 03:44:43 +00:00
resolve entities
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@802 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
c64354dee6
commit
ecd040e687
1 changed files with 3 additions and 3 deletions
|
|
@ -23,8 +23,8 @@ endtag_re = re.compile(r"""(?i)</a\s*>""")
|
|||
def image_name(txt):
|
||||
mo = imgtag_re.search(txt)
|
||||
if mo:
|
||||
name = StringUtil.stripQuotes(mo.group('name').strip())
|
||||
return StringUtil.remove_markup(name)
|
||||
name = StringUtil.remove_markup(mo.group('name').strip())
|
||||
return StringUtil.unquote(name)
|
||||
return ''
|
||||
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ def href_name(txt):
|
|||
name = txt[:endtag.start()]
|
||||
if img_re.search(name):
|
||||
return image_name(name)
|
||||
return StringUtil.remove_markup(name)
|
||||
return StringUtil.unhtmlify(StringUtil.remove_markup(name))
|
||||
|
||||
_tests = (
|
||||
"<img src='' alt=''></a>",
|
||||
|
|
|
|||
Loading…
Reference in a new issue