mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fixed possible issue with linking to interwiki
This commit is contained in:
parent
61015991a3
commit
f8b2d6ac71
|
@ -49,7 +49,9 @@ class MyHTMLParser(HTMLParser):
|
|||
for attr in attrs:
|
||||
if attr[0] == 'href':
|
||||
self.recent_href=attr[1]
|
||||
if not self.recent_href.startswith("https"):
|
||||
if self.recent_href.startswith("//"):
|
||||
self.recent_href = "https:{rest}".format(rest=self.recent_href)
|
||||
elif not self.recent_href.startswith("https"):
|
||||
self.recent_href = "https://{wiki}.gamepedia.com".format(wiki=settings["wiki"]) + self.recent_href
|
||||
def handle_data(self, data):
|
||||
if self.recent_href:
|
||||
|
|
Loading…
Reference in a new issue