From 7ad540777aed9f9dafdff700f1b1f0a2a64f5183 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 21 Sep 2019 15:10:40 +1000 Subject: [PATCH] mark regex strings as raw --- app/functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/functions.py b/app/functions.py index 8ca8122..9f76cc5 100644 --- a/app/functions.py +++ b/app/functions.py @@ -29,8 +29,8 @@ def extract_post(post): link.decompose() text = soup.get_text() - text = re.sub("https://([^/]+)/(@[^\s]+)", r"\2@\1", text) # put mastodon-style mentions back in - text = re.sub("https://([^/]+)/users/([^\s/]+)", r"@\2@\1", text) # put pleroma-style mentions back in + text = re.sub(r"https://([^/]+)/(@[^\s]+)", r"\2@\1", text) # put mastodon-style mentions back in + text = re.sub(r"https://([^/]+)/users/([^\s/]+)", r"@\2@\1", text) # put pleroma-style mentions back in text = text.rstrip("\n") # remove trailing newline(s) return text