Skip to content

Commit

Permalink
fix matching URLs by /title/ instead of /index.php/
Browse files Browse the repository at this point in the history
fixes #25
  • Loading branch information
lahwaacz committed Dec 7, 2021
1 parent b06d5b6 commit 216a217
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion ArchWiki/ArchWiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ class ArchWiki(MediaWiki):
def __init__(self, safe_filenames=False, **kwargs):
""" Parameters:
@safe_filenames: force self.get_local_filename() to return ASCII string
@resolve_redirects: whether to resolve redirects inside self.get_local_filename()
+ all keyword arguments of simplemediawiki.MediaWiki
"""
super().__init__(url, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion ArchWiki/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def update_links(self, root, relbase):
href = a.get("href")
if href is not None:
href = urllib.parse.unquote(href)
match = re.match("^/index.php/(.+?)(?:#(.+))?$", str(href))
match = re.match("^/title/(.+?)(?:#(.+))?$", str(href))
if match:
title = self.wiki.resolve_redirect(match.group(1))
try:
Expand Down

0 comments on commit 216a217

Please sign in to comment.