fix sharpen + chud with "trans women are women" phrase
parent
bc4d5cfe5d
commit
8b4682268e
|
@ -383,7 +383,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
|
||||||
sanitized = marsify(sanitized, author.chud_phrase)
|
sanitized = marsify(sanitized, author.chud_phrase)
|
||||||
|
|
||||||
if obj and obj.sharpened:
|
if obj and obj.sharpened:
|
||||||
sanitized = sharpen(sanitized, v)
|
sanitized = sharpen(sanitized, author.chud_phrase)
|
||||||
|
|
||||||
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)
|
||||||
|
@ -683,7 +683,7 @@ def filter_emojis_only(title, golden=True, count_emojis=False, obj=None, author=
|
||||||
title = marsify(title, author.chud_phrase)
|
title = marsify(title, author.chud_phrase)
|
||||||
|
|
||||||
if obj and obj.sharpened:
|
if obj and obj.sharpened:
|
||||||
title = sharpen(title, v)
|
title = sharpen(title, author.chud_phrase)
|
||||||
|
|
||||||
emojis_used = set()
|
emojis_used = set()
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
from files.helpers.regex import *
|
from files.helpers.regex import *
|
||||||
|
import re
|
||||||
|
|
||||||
def sharpen(string, v):
|
def sharpen(string, chud_phrase):
|
||||||
if v.chud_phrase:
|
if chud_phrase:
|
||||||
string = string.replace(v.chud_phrase, 'erfdsx34224e4535resfed')
|
string = re.sub(chud_phrase, 'erfdsx34224e4535resfed', string, flags=re.I)
|
||||||
|
|
||||||
string = the_fucking_regex.sub("\g<1> fucking", string)
|
string = the_fucking_regex.sub("\g<1> fucking", string)
|
||||||
string = bitch_question_mark_regex.sub(", bitch?", string)
|
string = bitch_question_mark_regex.sub(", bitch?", string)
|
||||||
string = exclamation_point_regex.sub(", motherfucker!", string)
|
string = exclamation_point_regex.sub(", motherfucker!", string)
|
||||||
|
|
||||||
if v.chud_phrase:
|
if chud_phrase:
|
||||||
string = string.replace('erfdsx34224e4535resfed', v.chud_phrase)
|
string = string.replace('erfdsx34224e4535resfed', chud_phrase)
|
||||||
|
|
||||||
return string
|
return string
|
||||||
|
|
Loading…
Reference in New Issue