fix: extra lines removed

This commit is contained in:
Cory Dransfeldt 2024-09-26 17:52:45 -07:00
parent 7d7edecafe
commit ae16e81f8e
No known key found for this signature in database
3 changed files with 6 additions and 4 deletions

View file

@ -44,11 +44,13 @@ async function handleMastodonPost(env) {
]
})
const content = truncateContent(title, plainTextDescription, link, maxLength)
const cleanedDescription = plainTextDescription.replace(/\s+/g, ' ').trim()
const content = truncateContent(title, cleanedDescription, link, maxLength)
await postToMastodon(mastodonApiUrl, accessToken, content)
const timestamp = new Date().toISOString()
await env.RSS_TO_MASTODON_NAMESPACE.put(item.link, timestamp)
console.log(`Posted stored URL: ${item.link}`)