Skip to content

Commit 3b4e036

Browse files
committed
Get href from dict
1 parent 6e5c16e commit 3b4e036

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/make_relative_to.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def on_page_content(html, page, config, files):
2020
log.warning(f'doc 1: {docs[1].src_uri}')
2121
page_path = Path(page.url)
2222
for element in href_elements:
23-
scheme, netloc, path, _, _ = urlsplit(element.href)
24-
log.warning(f'element.href: {element.href}')
23+
scheme, netloc, path, _, _ = urlsplit(element['href'])
24+
log.warning(f'element.href: {element['href']}')
2525
if scheme or netloc: # External link
2626
continue
2727
if not path: # Self-link containing only query or anchor.
@@ -30,7 +30,7 @@ def on_page_content(html, page, config, files):
3030
log.warning(f'resolved_path: {resolved_path}')
3131
if any(lambda x: x.src_uri.strip('README.md') == resolved_path, docs):
3232
continue
33-
element.href = urljoin(os.environ['BASE_URL'], page_path, element.href)
33+
element['href'] = urljoin(os.environ['BASE_URL'], page_path, element['href'])
3434
return soup.prettify()
3535

3636

0 commit comments

Comments
 (0)