forked from PrivateCoffee/wikimore
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:
parent
6cc25796a2
commit
4b08c70261
1 changed files with 1 additions and 1 deletions
|
@ -138,7 +138,7 @@ def wiki_article(project, lang, title):
|
||||||
logger.debug(f"Redirect URL: {destination}")
|
logger.debug(f"Redirect URL: {destination}")
|
||||||
return redirect(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"]
|
href = a["href"]
|
||||||
|
|
||||||
if href.startswith("/wiki/"):
|
if href.startswith("/wiki/"):
|
||||||
|
|
Loading…
Reference in a new issue