From 82704ae421da4a4331676bd7fd8ee112e3c492c6 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Tue, 4 Jun 2024 08:51:32 +1200 Subject: [PATCH] added comment --- app/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/utils.py b/app/utils.py index 2cd16610..4a54b5cf 100644 --- a/app/utils.py +++ b/app/utils.py @@ -191,6 +191,7 @@ def allowlist_html(html: str) -> str: url = False for t in re_url.split(tag.string): if re_url.match(t): + # Avoid picking up trailing punctuation for raw URLs in text href = t[:-1] if t[-1] in ['.', ',', ')', '!', ':', ';', '?'] else t a = soup.new_tag("a", href=href) a.string = href