summaryrefslogtreecommitdiff
path: root/packages/backend/src/queue/processors
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2024-02-03 12:05:08 +0000
committerdakkar <dakkar@thenautilus.net>2024-02-03 12:05:08 +0000
commit1bb5021c5479ad4a6bfad2714a4a4f2b6ba02493 (patch)
tree652f005770be92ef2e6a5a716dc99a4c25fc75df /packages/backend/src/queue/processors
parentsimpler logic (diff)
downloadsharkey-1bb5021c5479ad4a6bfad2714a4a4f2b6ba02493.tar.gz
sharkey-1bb5021c5479ad4a6bfad2714a4a4f2b6ba02493.tar.bz2
sharkey-1bb5021c5479ad4a6bfad2714a4a4f2b6ba02493.zip
decode entity references from tweets
apparently *some* tweets have those ☹
Diffstat (limited to 'packages/backend/src/queue/processors')
-rw-r--r--packages/backend/src/queue/processors/ImportNotesProcessorService.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts
index 2476f94359..44c92fabb6 100644
--- a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts
+++ b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts
@@ -584,7 +584,8 @@ export class ImportNotesProcessorService {
try {
const date = new Date(tweet.created_at);
- const textReplaceURLs = tweet.entities.urls && tweet.entities.urls.length > 0 ? await replaceTwitterUrls(tweet.full_text, tweet.entities.urls) : tweet.full_text;
+ const decodedText = tweet.full_text.replaceAll('&gt;','>').replaceAll('&lt;','<').replaceAll('&amp;','&');
+ const textReplaceURLs = tweet.entities.urls && tweet.entities.urls.length > 0 ? await replaceTwitterUrls(decodedText, tweet.entities.urls) : decodedText;
const text = tweet.entities.user_mentions && tweet.entities.user_mentions.length > 0 ? await replaceTwitterMentions(textReplaceURLs, tweet.entities.user_mentions) : textReplaceURLs;
const files: MiDriveFile[] = [];