Ignore fixby elements without the src attribute.
This commit is contained in:
parent
36dde281d6
commit
1523fbbd3e
1 changed files with 3 additions and 1 deletions
|
@ -173,7 +173,9 @@ def soup_adjust_relative_links(soup, md_file, repo_path):
|
||||||
def fixby(tagname, attribute):
|
def fixby(tagname, attribute):
|
||||||
links = soup.find_all(tagname)
|
links = soup.find_all(tagname)
|
||||||
for link in links:
|
for link in links:
|
||||||
href = link[attribute]
|
href = link.get(attribute)
|
||||||
|
if not href:
|
||||||
|
continue
|
||||||
if '://' in href:
|
if '://' in href:
|
||||||
continue
|
continue
|
||||||
if href.startswith('/'):
|
if href.startswith('/'):
|
||||||
|
|
Loading…
Reference in a new issue