From b519b0e8acbe26c37625a899157bacda198ccedb Mon Sep 17 00:00:00 2001 From: Brian Read Date: Sun, 18 May 2025 09:51:56 +0200 Subject: [PATCH] map spaces to underscores in the title for wiki link --- wiki rss to rocket chat.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wiki rss to rocket chat.py b/wiki rss to rocket chat.py index 3f683bf..7ab447c 100644 --- a/wiki rss to rocket chat.py +++ b/wiki rss to rocket chat.py @@ -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"