Skip to content

Commit 105025a

Browse files
authored
Merge pull request #1141 from owlcode/clean-newlines-from-new-tweets
clean newlines for new tweet
2 parents 9348c97 + db9580d commit 105025a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/client-twitter/src/post.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,11 @@ export class TwitterPostClient {
276276
const removeQuotes = (str: string) =>
277277
str.replace(/^['"](.*)['"]$/, "$1");
278278

279+
const fixNewLines = (str: string) =>
280+
str.replaceAll(/\\n/g, "\n");
281+
279282
// Final cleaning
280-
cleanedContent = removeQuotes(content);
283+
cleanedContent = removeQuotes(fixNewLines(content));
281284

282285
if (this.runtime.getSetting("TWITTER_DRY_RUN") === "true") {
283286
elizaLogger.info(

0 commit comments

Comments
 (0)