Skip to content

Commit bd66835

Browse files
authored
Merge branch 'develop' into tcm-transcription-config
2 parents 37ffc83 + 64cfc07 commit bd66835

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/client-twitter/src/post.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ export class TwitterPostClient {
464464
.replace(/^\s*{?\s*"text":\s*"|"\s*}?\s*$/g, "") // Remove JSON-like wrapper
465465
.replace(/^['"](.*)['"]$/g, "$1") // Remove quotes
466466
.replace(/\\"/g, '"') // Unescape quotes
467-
.replace(/\\n/g, "\n") // Unescape newlines
467+
.replace(/\\n/g, "\n\n") // Unescape newlines, ensures double spaces
468468
.trim();
469469
}
470470

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

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

496496
// Final cleaning
497497
cleanedContent = removeQuotes(fixNewLines(cleanedContent));

0 commit comments

Comments
 (0)