From 4a8e87142bf7b1036127a9042401dabe71797855 Mon Sep 17 00:00:00 2001 From: MathiasDPX Date: Thu, 17 Apr 2025 18:20:31 +0200 Subject: [PATCH] Fix link interpreted as tag --- routes/scrapbook.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/routes/scrapbook.py b/routes/scrapbook.py index a47c411..df1d531 100644 --- a/routes/scrapbook.py +++ b/routes/scrapbook.py @@ -36,8 +36,14 @@ def convert_slack_references(text): channel_name = channels_maps.get(channel_id, channel_id) return f'#{channel_name}' - result = re.sub(channel_pattern, channel_replacement, text) + url_pattern = r'<(http(?:|s):\/\/[a-zA-Z0-9\.\/_-]+)>' + def url_replacement(match): + url = match.group(1) + return f'{url}' + result = re.sub(url_pattern, url_replacement, text) + result = re.sub(channel_pattern, channel_replacement, result) + return result @sp_routes.route("/scrapbook")