fix: make user/community links case insensitive

This commit is contained in:
Xylight committed 2024-07-25 12:11:58 -07:00
1 parent 81926abcc7
commit e1f3675130
1 file changed
+2 -2
+2 -2
View File
@@ -57,7 +57,7 @@ const communityLinks = {
if (!self.re.community) { if (!self.re.community) {
self.re.community = new RegExp( self.re.community = new RegExp(
/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z]{2,6})/ /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z]{2,6})/i
) )
} }
if (self.re.community.test(tail)) { if (self.re.community.test(tail)) {
@@ -83,7 +83,7 @@ const userLinks = {
var tail = text.slice(pos) var tail = text.slice(pos)
if (!self.re.user) { if (!self.re.user) {
self.re.user = new RegExp(/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z]{2,6})/) self.re.user = new RegExp(/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z]{2,6})/i)
} }
if (self.re.user.test(tail)) { if (self.re.user.test(tail)) {
// Linkifier allows punctuation chars before prefix, // Linkifier allows punctuation chars before prefix,