Skip to content

Commit

Permalink
[Cherry Pick] Fix [Utils] Regex trimTopic
Browse files Browse the repository at this point in the history
- [+] fix(utils.ts): update regular expressions in trimTopic function to handle asterisks
  • Loading branch information
H0llyW00dzZ committed Feb 20, 2024
1 parent e756506 commit 22baeba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 22baeba

Please sign in to comment.