mirror of
				https://github.com/Yidadaa/ChatGPT-Next-Web.git
				synced 2025-11-04 08:26:12 +08:00 
			
		
		
		
	Merge pull request #4089 from H0llyW00dzZ/cherry-pick
[Cherry Pick] Fix [Utils] Regex trimTopic
This commit is contained in:
		@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user