re.escape nicknames for highlight prevention

This commit is contained in:
jesopo 2019-05-28 08:18:42 +01:00
parent e483d4574b
commit 113a3b6405

View file

@ -485,7 +485,8 @@ class Module(ModuleManager.BaseModule):
continue
regex = re.compile(r"(.)\b(%s)(%s)" % (
user.nickname[0], user.nickname[1:]), re.I)
re.escape(user.nickname[0]), re.escape(user.nickname[1:])),
re.I)
s = regex.sub("\\1\\2\u200c\\3", s)
return s