map spaces to underscores in the title for wiki link
This commit is contained in:
parent
9b1151290b
commit
b519b0e8ac
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user