Skip to content

Commit

Permalink
ci: fix level select links to scraped pages
Browse files Browse the repository at this point in the history
  • Loading branch information
sondregronas committed Sep 3, 2024
1 parent 22e6943 commit 45ec05d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/web_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ def get_html(link):

# A hack to fix media links
if "/lang/" in link:
lang = link.split("/lang/")[1].split("/")[0]
html = re.sub(r'href="attachments/', 'href="../../attachments/', html)
html = re.sub(r'src="attachments/', 'src="../../attachments/', html)
html = re.sub(
rf"""href=\"({link.split('Level')[0].split("/")[-1]}[^/]+)\"""", rf'href="../../\1/lang/{lang}"', html
)

return html

Expand Down

0 comments on commit 45ec05d

Please sign in to comment.