瀏覽代碼

[Cherry Pick] Fix [Utils] Regex trimTopic

- [+] fix(utils.ts): update regular expressions in trimTopic function to handle asterisks
H0llyW00dzZ 1 年之前
父節點
當前提交
22baebaf8c
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/utils.ts

+ 3 - 2
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) {