Long hashtags are invalid

main
Bob Mottram 2020-08-07 21:43:54 +01:00
parent cc90910908
commit 2f2034d0ec
1 changed files with 3 additions and 0 deletions

View File

@ -267,6 +267,9 @@ def addWebLinks(content: str) -> str:
def validHashTag(hashtag: str) -> bool:
"""Returns true if the give hashtag contains valid characters
"""
# long hashtags are not valid
if len(hashtag) >= 32:
return False
validChars = set('0123456789' +
'abcdefghijklmnopqrstuvwxyz' +
'ABCDEFGHIJKLMNOPQRSTUVWXYZ')