forked from rDrama/rDrama
rename a variable for clarity
parent
f11c687866
commit
8efb8de6cb
|
@ -43,7 +43,7 @@ title_regex = re.compile("[^\w ]", flags=re.A)
|
|||
controversial_regex = re.compile('https:\/\/old\.reddit\.com/r/\w{2,20}\/comments\/[\w\-.#&/=\?@%+]{5,250}', flags=re.A)
|
||||
|
||||
spoiler_regex = re.compile('\|\|(.+?)\|\|' + NOT_IN_CODE_OR_LINKS, flags=re.A)
|
||||
sub_regex = re.compile('(?<![\w/])\/?([hH]\/\w{3,25})' + NOT_IN_CODE_OR_LINKS, flags=re.A)
|
||||
hole_mention_regex = re.compile('(?<![\w/])\/?([hH]\/\w{3,25})' + NOT_IN_CODE_OR_LINKS, flags=re.A)
|
||||
|
||||
strikethrough_regex = re.compile('(^|\s|>|")~{1,2}([^~]+)~{1,2}' + NOT_IN_CODE_OR_LINKS, flags=re.A)
|
||||
|
||||
|
|
|
@ -449,7 +449,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
|
|||
sanitized = sanitized.replace('<a href="/%21', '<a href="/!')
|
||||
|
||||
sanitized = reddit_mention_regex.sub(r'<a href="https://old.reddit.com/\1" rel="nofollow noopener" target="_blank">/\1</a>', sanitized)
|
||||
sanitized = sub_regex.sub(r'<a href="/\1">/\1</a>', sanitized)
|
||||
sanitized = hole_name_regex.sub(r'<a href="/\1">/\1</a>', sanitized)
|
||||
|
||||
v = getattr(g, 'v', None)
|
||||
|
||||
|
|
Loading…
Reference in New Issue