diff --git a/src/backend/html_markdown.py b/src/backend/html_markdown.py index 76f40cfe..e8bd817a 100644 --- a/src/backend/html_markdown.py +++ b/src/backend/html_markdown.py @@ -120,13 +120,13 @@ class HTMLProcessor: user_id_localpart = r"[\x21-\x39\x3D-\x7E]+?" user_id_regex = re.compile( - rf"(?P@{user_id_localpart}:(?P[a-zA-Z\d.-:]*[a-zA-Z\d]))", + rf"(?P@{user_id_localpart}:(?P[a-zA-Z\d.:-]*[a-zA-Z\d]))", ) room_id_regex = re.compile( - rf"(?P!{opaque_id}:(?P[a-zA-Z\d.-:]*[a-zA-Z\d]))", + rf"(?P!{opaque_id}:(?P[a-zA-Z\d.:-]*[a-zA-Z\d]))", ) room_alias_regex = re.compile( - r"(?=^|\W)(?P#\S+?:(?P[a-zA-Z\d.-:]*[a-zA-Z\d]))", + r"(?=^|\W)(?P#\S+?:(?P[a-zA-Z\d.:-]*[a-zA-Z\d]))", ) link_regexes = [re.compile(r, re.IGNORECASE) @@ -136,7 +136,7 @@ class HTMLProcessor: r"(?:/[/\-_.,a-z\d#%&?;=~]*)?(?:\([/\-_.,a-z\d#%&?;=~]*\))?)"), # mailto: and tel: - r"mailto:(?P[a-z0-9._-]+@(?P[a-z0-9.-:]*[a-z\d]))", + r"mailto:(?P[a-z0-9._-]+@(?P[a-z0-9.:-]*[a-z\d]))", r"tel:(?P[0-9+-]+)(?P)", # magnet: