From d80e049bb03f02ac60f9fa0949154a0467239e41 Mon Sep 17 00:00:00 2001 From: Jason McBrayer Date: Wed, 16 Oct 2024 17:12:52 -0400 Subject: [PATCH] Fix broken whitespace in redraft This still doesn't, for example, reconstruct the markdown the author may have used to format their post. --- brutaldon/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brutaldon/views.py b/brutaldon/views.py index 3c8288c..2608ab8 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -766,7 +766,7 @@ def redraft(request, id): toot_content = re.sub("(^\n)|(\n$)", "", re.sub("\n\n", "\n", toot_content)) # Fix up references for mention in toot.mentions: - menchie_re = re.compile(r"\s?@" + mention.username + r"\s", re.I) + menchie_re = re.compile(r"\s?@\s" + mention.acct + r"\s", re.I) toot_content = menchie_re.sub( " @" + mention.acct + " ", toot_content, count=1 )