forked from MarseyWorld/MarseyWorld
make linking to link groups case insensitive
parent
90e2fe8469
commit
af620ac05e
|
@ -9,7 +9,7 @@ valid_username_chars = 'a-zA-Z0-9_\-'
|
|||
valid_username_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$", flags=re.A)
|
||||
mention_regex = re.compile('(^|\s|>)@([a-zA-Z0-9_\-]{1,30})(?!([^<]*<\/(code|pre|a)>|[^`]*`))', flags=re.A)
|
||||
|
||||
group_mention_regex = re.compile('(^|\s|>)!([a-z0-9_\-]{3,25})(?!([^<]*<\/(code|pre|a)>|[^`]*`))', flags=re.A)
|
||||
group_mention_regex = re.compile('(^|\s|>)!([a-z0-9_\-]{3,25})(?!([^<]*<\/(code|pre|a)>|[^`]*`))', flags=re.A|re.I)
|
||||
|
||||
everyone_regex = re.compile('(^|\s|>)!(everyone)(?!([^<]*<\/(code|pre|a)>|[^`]*`))', flags=re.A)
|
||||
|
||||
|
|
|
@ -391,7 +391,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys
|
|||
else:
|
||||
existing = g.db.get(Group, name)
|
||||
if existing:
|
||||
sanitized = sanitized.replace(i.group(0), f'{i.group(1)}<a href="/!{i.group(2)}">!{i.group(2)}</a>', 1)
|
||||
sanitized = sanitized.replace(i.group(0), f'{i.group(1)}<a href="/!{name}">!{name}</a>', 1)
|
||||
|
||||
soup = BeautifulSoup(sanitized, 'lxml')
|
||||
|
||||
|
|
Loading…
Reference in New Issue