minor rename for less future confusion
parent
6a30528634
commit
33f8d5a88c
|
@ -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)
|
||||
reddit_regex = re.compile('(?<![\w/])\/?(([ruRU])\/(\w|-){2,25})' + NOT_IN_CODE_OR_LINKS, flags=re.A)
|
||||
reddit_mention_regex = re.compile('(?<![\w/])\/?(([ruRU])\/(\w|-){2,25})' + 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)
|
||||
|
||||
strikethrough_regex = re.compile('(^|\s|>|")~{1,2}([^~]+)~{1,2}' + NOT_IN_CODE_OR_LINKS, flags=re.A)
|
||||
|
|
|
@ -447,7 +447,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
|
|||
|
||||
sanitized = sanitized.replace('<a href="/%21', '<a href="/!')
|
||||
|
||||
sanitized = reddit_regex.sub(r'<a href="https://old.reddit.com/\1" rel="nofollow noopener" target="_blank">/\1</a>', sanitized)
|
||||
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)
|
||||
|
||||
v = getattr(g, 'v', None)
|
||||
|
|
Loading…
Reference in New Issue