Add Bluesky replies, quotes, and reposts to any web page. Handy for adding a comments section anywhere.
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix double 'and' in repostedBy and empty names edge case

formatRepostedBy was pushing an 'and X other people' suffix into
the names array then passing it to oxfordComma(), which added a
second 'and' before the last item. Also handled the case where
the repostedBy array is empty but repostCount is non-zero (API
returns up to 25 but the count can be higher).

Jim Ray 37b86601 e1ed743d

+4 -3
+4 -3
bsky-conversation.js
··· 265 265 }) 266 266 const remaining = repostCount - names.length 267 267 if (remaining > 0) { 268 - const suffix = `and <a href="${url}/reposted-by" target="_blank" rel="noopener noreferrer">${intword(remaining)} other people</a>` 269 - names.push(suffix) 270 - return oxfordComma(names) 268 + const othersLink = `<a href="${url}/reposted-by" target="_blank" rel="noopener noreferrer">${intword(remaining)} other people</a>` 269 + if (names.length === 0) return othersLink 270 + if (names.length === 1) return `${names[0]} and ${othersLink}` 271 + return `${names.join(', ')}, and ${othersLink}` 271 272 } 272 273 return oxfordComma(names) 273 274 }