From 21184c368a8a50e4bf1cc9ad25075a3ee9c15f66 Mon Sep 17 00:00:00 2001 From: Alain St-Denis Date: Tue, 13 Feb 2024 16:57:56 -0500 Subject: [PATCH] Increase the Unicode character range allowed in Diaspora mentions. --- federation/utils/text.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/federation/utils/text.py b/federation/utils/text.py index bf1f235..063b5ad 100644 --- a/federation/utils/text.py +++ b/federation/utils/text.py @@ -8,8 +8,8 @@ from commonmark import commonmark ILLEGAL_TAG_CHARS = "!#$%^&*+.,@£/()=?`'\\{[]}~;:\"’”—\xa0" TAG_PATTERN = re.compile(r'(#[\w\-]+)([)\]_!?*%/.,;\s]+\s*|\Z)', re.UNICODE) -# This will match non matching braces. I don't think it's an issue. -MENTION_PATTERN = re.compile(r'(@\{?(?:[\w\-. \u263a-\U0001f645]*; *)?[\w]+@[\w\-.]+\.[\w]+}?)', re.UNICODE) +# This will match non-matching braces. I don't think it's an issue. +MENTION_PATTERN = re.compile(r'(@\{?(?:[\w\-. \u0250-\U0001f64f]*; *)?[\w]+@[\w\-.]+\.[\w]+}?)', re.UNICODE) # based on https://stackoverflow.com/a/6041965 URL_PATTERN = re.compile(r'((?:(?:https?|ftp)://|^|(?<=[("<\s]))+(?:[\w\-]+(?:(?:\.[\w\-]+)+))' r'[\w.,;:@?!$()*^=%&/~+\-#]*(?"]))',