From a84a9887189afde775b8d5f3bbb8f92835230d41 Mon Sep 17 00:00:00 2001 From: Believethehype <1097224+believethehype@users.noreply.github.com> Date: Thu, 25 Apr 2024 21:08:58 +0200 Subject: [PATCH] add some more content warning words --- ui/noogle/src/components/helper/string.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/noogle/src/components/helper/string.ts b/ui/noogle/src/components/helper/string.ts index 8b14418..1a812c0 100644 --- a/ui/noogle/src/components/helper/string.ts +++ b/ui/noogle/src/components/helper/string.ts @@ -10,7 +10,7 @@ const Regex_Nip05_Str= "(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^ const StringUtil = { isValidUrl: (str: string): boolean => new RegExp(Regex_Url_Str, "i").test(str), parseHyperlinks: (str: string): string => str.replace(new RegExp(Regex_Urlw_Str, "gim"), "$&").replace(new RegExp(Regex_Nip05_Str, "gim"), "$& "), - parseImages: (str: string): string => str.toLowerCase().includes('nsfw') ? str.replace(new RegExp(Regex_Url_Img, "gim"), "
NSFW Show/Hide Results
").replace(new RegExp(Regex_Url_Video, "gim"), "
NSFW Show/Hide Results
").replace(new RegExp(Regex_Url_Str, "gim"), "$& ") : str.replace(new RegExp(Regex_Url_Img, "gim"), " ").replace(new RegExp(Regex_Url_Video, "gim"), " ").replace(new RegExp(Regex_Url_Str, "gim"), "$& "), + parseImages: (str: string): string => str.toLowerCase().includes('nsfw') || str.toLowerCase().includes('lingerie') || str.toLowerCase().includes('sex') || str.toLowerCase().includes('porn') ? str.replace(new RegExp(Regex_Url_Img, "gim"), "
NSFW Show/Hide Results
").replace(new RegExp(Regex_Url_Video, "gim"), "
NSFW Show/Hide Results
").replace(new RegExp(Regex_Url_Str, "gim"), "$& ") : str.replace(new RegExp(Regex_Url_Img, "gim"), " ").replace(new RegExp(Regex_Url_Video, "gim"), " ").replace(new RegExp(Regex_Url_Str, "gim"), "$& "), //parseImages: (str: string): string => str.replace("\n", " ").replace(new RegExp(Regex_Url_Img, "gim"), " ")