Skip to content

Commit

Permalink
Merge branch 'develop' into tcm-transcription-config
Browse files Browse the repository at this point in the history
  • Loading branch information
odilitime authored Jan 1, 2025
2 parents 37ffc83 + 64cfc07 commit bd66835
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/client-twitter/src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ export class TwitterPostClient {
.replace(/^\s*{?\s*"text":\s*"|"\s*}?\s*$/g, "") // Remove JSON-like wrapper
.replace(/^['"](.*)['"]$/g, "$1") // Remove quotes
.replace(/\\"/g, '"') // Unescape quotes
.replace(/\\n/g, "\n") // Unescape newlines
.replace(/\\n/g, "\n\n") // Unescape newlines, ensures double spaces
.trim();
}

Expand All @@ -491,7 +491,7 @@ export class TwitterPostClient {
const removeQuotes = (str: string) =>
str.replace(/^['"](.*)['"]$/, "$1");

const fixNewLines = (str: string) => str.replaceAll(/\\n/g, "\n");
const fixNewLines = (str: string) => str.replaceAll(/\\n/g, "\n\n"); //ensures double spaces

// Final cleaning
cleanedContent = removeQuotes(fixNewLines(cleanedContent));
Expand Down

0 comments on commit bd66835

Please sign in to comment.