master
Aevann1 2021-08-26 18:33:20 +02:00
parent 5cda3ebab9
commit 1f941db168
1 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ enter_re=re.compile("(\n\r?\w+){3,}")
class UserMention(SpanToken): class UserMention(SpanToken):
pattern = re.compile("(^|\s|\n)@(\w{1,25})") pattern = re.compile("(^|\s|\n)@((\w|-){1,25})")
parse_inner = False parse_inner = False
def __init__(self, match_obj): def __init__(self, match_obj):
@ -34,7 +34,7 @@ class SubMention(SpanToken):
class RedditorMention(SpanToken): class RedditorMention(SpanToken):
pattern = re.compile("(^|\s|\n)u/(\w{3,25})") pattern = re.compile("(^|\s|\n)u/((\w|-){3,25})")
parse_inner = False parse_inner = False
def __init__(self, match_obj): def __init__(self, match_obj):
@ -52,7 +52,7 @@ class SubMention2(SpanToken):
class RedditorMention2(SpanToken): class RedditorMention2(SpanToken):
pattern = re.compile("(^|\s|\n)/u/(\w{3,25})") pattern = re.compile("(^|\s|\n)/u/((\w|-){3,25})")
parse_inner = False parse_inner = False
def __init__(self, match_obj): def __init__(self, match_obj):