forked from rDrama/rDrama
parent
1c43e506e9
commit
a6f3a4a05b
|
@ -35,7 +35,7 @@ def queenify_tag_string(string):
|
||||||
|
|
||||||
return initial + string
|
return initial + string
|
||||||
|
|
||||||
def queenify(html):
|
def queenify_html(html):
|
||||||
if '<p>&&' in html or '<p>$$' in html or '<p>##' in html:
|
if '<p>&&' in html or '<p>$$' in html or '<p>##' in html:
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
|
|
@ -385,9 +385,6 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
|
||||||
if obj and obj.sharpened:
|
if obj and obj.sharpened:
|
||||||
sanitized = sharpen(sanitized)
|
sanitized = sharpen(sanitized)
|
||||||
|
|
||||||
if obj and obj.queened:
|
|
||||||
sanitized = queenify(sanitized)
|
|
||||||
|
|
||||||
if '```' not in sanitized and '<pre>' not in sanitized:
|
if '```' not in sanitized and '<pre>' not in sanitized:
|
||||||
sanitized = linefeeds_regex.sub(r'\1\n\n\2', sanitized)
|
sanitized = linefeeds_regex.sub(r'\1\n\n\2', sanitized)
|
||||||
|
|
||||||
|
@ -407,6 +404,9 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
|
||||||
sanitized = markdown(sanitized)
|
sanitized = markdown(sanitized)
|
||||||
sanitized = sanitized.replace('▔', '_').replace('%E2%96%94', '_')
|
sanitized = sanitized.replace('▔', '_').replace('%E2%96%94', '_')
|
||||||
|
|
||||||
|
if obj and obj.queened:
|
||||||
|
sanitized = queenify_html(sanitized)
|
||||||
|
|
||||||
sanitized = sanitized.replace('<a href="/%21', '<a href="/!')
|
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 = reddit_mention_regex.sub(r'<a href="https://old.reddit.com/\1" rel="nofollow noopener" target="_blank">/\1</a>', sanitized)
|
||||||
|
|
Loading…
Reference in New Issue