map spaces to underscores in the title for wiki link

This commit is contained in:
Brian Read 2025-05-18 09:51:56 +02:00
parent 9b1151290b
commit b519b0e8ac

View File

@ -148,7 +148,10 @@ def main(one_shot=False, empty_db=False):
match = re.search(r'(.*?title=.*?)(.*)', data["id"])
if match:
wiki_link = match.group(1) + title
# Replace spaces with underscores in the title
title_modified = title.replace(' ', '_')
# Concatenate match.group(1) and modified title
wiki_link = match.group(1) + title_modified
wiki_id = match.group(2)
else:
wiki_id = "Unexpected link"