From bc0a9b97995b43fae2d127ec4c614bdbdec21e41 Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Wed, 21 Feb 2024 04:21:18 +0700 Subject: [PATCH] Fix [Utils] Regex trimTopic (#280) - [+] fix(utils.ts): update regular expressions in trimTopic function to handle asterisks --- app/utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/utils.ts b/app/utils.ts index d802cc6f7d8..8e5d33862f9 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -11,8 +11,9 @@ export function trimTopic(topic: string) { // This will remove the specified punctuation from the end of the string // and also trim quotes from both the start and end if they exist. return topic - .replace(/^["“”]+|["“”]+$/g, "") - .replace(/[,。!?”“"、,.!?]*$/, ""); + // fix for gemini + .replace(/^["“”*]+|["“”*]+$/g, "") + .replace(/[,。!?”“"、,.!?*]*$/, ""); } const isApp = !!getClientConfig()?.isApp;