diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index 8780cc186..484635e16 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -191,9 +191,15 @@ if SITE_NAME == 'rDrama': " cool (?!it)": " fetch ", "krayon": "krayon (sister toucher)", "discord": "groomercord", + "allah(?! \()": "Allah (ﷻ)", + "muhammad(?! \()": "Prophet Muhammad (ﷺ)" } SLURS.update(RDRAMA_SLURS) + SLURS_FOR_REPLACING = {} + for k, val in SLURS.items(): + SLURS_FOR_REPLACING[k.split('(')[0]] = val + BOOSTED_SITES = { #youtube-like 'bitchute.com', diff --git a/files/helpers/regex.py b/files/helpers/regex.py index 08a9b4282..a3fb42f7f 100644 --- a/files/helpers/regex.py +++ b/files/helpers/regex.py @@ -119,24 +119,22 @@ knowledgebase_page_regex = re.compile("[a-zA-Z0-9_\-]+", flags=re.A) html_title_regex = re.compile("(.{1,200})", flags=re.I) -def sub_matcher(match:re.Match, upper=False, replace_with:Union[dict[str, str], dict[str, List[str]]]=SLURS): +def sub_matcher(match:re.Match, upper=False, replace_with:Union[dict[str, str], dict[str, List[str]]]=SLURS_FOR_REPLACING): group_num = 0 match_str = match.group(group_num) if match_str.startswith('<'): return match_str - elif match_str.lower() == ' cool ': - return ' fetch ' else: repl = replace_with[match_str.lower()] return repl if not upper or "