Escape / with %2F in wiki URLs. For now this includes things which actually should be subdirectories, such as the various dexes.

This commit is contained in:
Adrian Kuschelyagi Malacoda 2020-08-23 05:01:11 -05:00
parent df25b09eb7
commit ea7e1294b1
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ class ArchiveGenerator():
if page.namespace != WIKI_NAMESPACES['MAIN']:
continue
page_out = "{}.html".format(page.title).replace(" ", "_")
page_out = f"{reformat_page_title(page.title)}.html"
base = ""
if "/" in page_out:
base = "../" * page_out.count("/")

View File

@ -178,7 +178,7 @@ def translate_image_title (page_title):
return reformat_page_title(page_title[len(namespace):])
def reformat_page_title (page_title):
return "{}{}".format(page_title[0].upper(), page_title[1:].replace(" ", "_"))
return "{}{}".format(page_title[0].upper(), page_title[1:].replace(" ", "_").replace("/", "%2F"))
class Template():
def __init__ (self, wikicode):