From 22baebaf8c49f81bb22c39a7753ac6695d515166 Mon Sep 17 00:00:00 2001 From: H0llyW00dzZ Date: Wed, 21 Feb 2024 04:19:12 +0700 Subject: [PATCH] [Cherry Pick] Fix [Utils] Regex trimTopic - [+] 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 33b8eccd2..b502eab36 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -9,8 +9,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(/[,。!?”“"、,.!?*]*$/, ""); } export async function copyToClipboard(text: string) {