fix(wikimore): ensure links from image maps are processed

Enhanced link extraction to include `<area>` elements for better handling of image maps. This change ensures that all navigable links within an article, including those from image maps, are processed correctly.

Fixes #8.
This commit is contained in:
Kumi 2024-08-18 07:17:18 +02:00
parent 6cc25796a2
commit 4b08c70261
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -138,7 +138,7 @@ def wiki_article(project, lang, title):
logger.debug(f"Redirect URL: {destination}")
return redirect(destination)
for a in soup.find_all("a", href=True):
for a in soup.find_all("a", href=True) + soup.find_all("area", href=True):
href = a["href"]
if href.startswith("/wiki/"):