Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#3455 from H0llyW00dzZ/trimtopic
Browse files Browse the repository at this point in the history
  • Loading branch information
Yidadaa authored Dec 6, 2023
2 parents cf50299 + 54df355 commit 28c1260
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { showToast } from "./components/ui-lib";
import Locale from "./locales";

export function trimTopic(topic: string) {
return topic.replace(/[,。!?”“"、,.!?]*$/, "");
// Fix an issue where double quotes still show in the Indonesian language
// 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(/[,。!?”“"、,.!?]*$/, "");
}

export async function copyToClipboard(text: string) {
Expand Down

0 comments on commit 28c1260

Please sign in to comment.