From 534a88da544e13b45fc45c109879bd0579ad5d00 Mon Sep 17 00:00:00 2001 From: Believethehype <1097224+believethehype@users.noreply.github.com> Date: Thu, 25 Apr 2024 21:03:28 +0200 Subject: [PATCH] noogle discovery: content tagged with nsfw needs to be manually clicked to show --- 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 717663a..8b14418 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.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.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"), " ")