소스 검색

Merge pull request #4089 from H0llyW00dzZ/cherry-pick

[Cherry Pick] Fix [Utils] Regex trimTopic
fred-bf 1 년 전
부모
커밋
1294817103
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) {