dont link to groups that dont exist

master
Aevann 2023-03-03 23:21:04 +02:00
parent ff6c4f89ad
commit c94dd20af0
1 changed files with 1 additions and 1 deletions

View File

@ -427,7 +427,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys
else:
existing = g.db.get(Group, name)
if existing:
sanitized = group_mention_regex.sub(r'\1<a href="/!\2">!\2</a>', sanitized)
sanitized = sanitized.replace(i.group(0), f'{i.group(1)}<a href="/!{i.group(2)}">!{i.group(2)}</a>')
soup = BeautifulSoup(sanitized, 'lxml')