forked from MarseyWorld/MarseyWorld
remove twitter tracking
parent
90181024cc
commit
2a0e288e12
|
@ -23,6 +23,7 @@ description_regex = re.compile("[^<>&\n\t]{1,300}", flags=re.A)
|
|||
|
||||
badge_name_regex = re.compile("[A-Za-z0-9 ]+", flags=re.A)
|
||||
|
||||
twitter_regex = re.compile("(https:\/\/twitter.com\/[A-Za-z0-9_/]+)\?\S*", flags=re.A)
|
||||
|
||||
valid_sub_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$", flags=re.A)
|
||||
|
||||
|
|
|
@ -278,6 +278,8 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys
|
|||
|
||||
sanitized = normalize_url(sanitized)
|
||||
|
||||
sanitized = twitter_regex.sub(r'\1', sanitized)
|
||||
|
||||
if '```' not in sanitized and '<pre>' not in sanitized:
|
||||
sanitized = linefeeds_regex.sub(r'\1\n\n\2', sanitized)
|
||||
|
||||
|
|
Loading…
Reference in New Issue