Aevann 2023-10-26 19:55:29 +03:00
parent 1c43e506e9
commit a6f3a4a05b
2 changed files with 4 additions and 4 deletions

View File

@ -35,7 +35,7 @@ def queenify_tag_string(string):
return initial + string
def queenify(html):
def queenify_html(html):
if '<p>&amp;&amp;' in html or '<p>$$' in html or '<p>##' in html:
return html

View File

@ -385,9 +385,6 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
if obj and obj.sharpened:
sanitized = sharpen(sanitized)
if obj and obj.queened:
sanitized = queenify(sanitized)
if '```' not in sanitized and '<pre>' not in 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 = sanitized.replace('', '_').replace('%E2%96%94', '_')
if obj and obj.queened:
sanitized = queenify_html(sanitized)
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)