Skip to content

Commit

Permalink
anchors like <a name=".."> do not contain a href element
Browse files Browse the repository at this point in the history
  • Loading branch information
zopyx committed Jan 7, 2019
1 parent a2f4497 commit 0c61404
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plone/outputfilters/filters/resolveuid_and_caption.py
Expand Up @@ -114,7 +114,10 @@ def __call__(self, data):

for elem in soup.find_all(['a', 'area']):
attributes = elem.attrs
href = attributes['href']
href = attributes.get('href')
# an 'a' anchor element has no href
if not href:
continue
url_parts = urlsplit(href)
scheme = url_parts[0]
# we are only interested in path and beyond /foo/bar?x=2#abc
Expand Down

0 comments on commit 0c61404

Please sign in to comment.