Skip to content

Commit b8c96ab

Browse files
committed
Fix username regex: A username can only contain alphanumeric characters (letters A-Z, numbers 0-9) with the exception of underscores
1 parent 07c01a3 commit b8c96ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/wall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def text(t):
168168
start, end = url['indices']
169169
t['text'] = t['text'][0:start] + a + t['text'][end:]
170170

171-
t['text'] = re.sub(' @([^ ]+)', r' <a href="https://twitter.com/\g<1>">@\g<1></a>', t['text'])
171+
t['text'] = re.sub('@([A-Za-z0-9_]+)', r'<a href="https://twitter.com/\g<1>">@\g<1></a>', t['text'])
172172
t['text'] = re.sub(' #([^ ]+)', r' <a href="https://twitter.com/search?q=%23\g<1>&src=hash">#\g<1></a>', t['text'])
173173

174174
html = """

0 commit comments

Comments
 (0)