Bluesky app fork with some witchin' additions 馃挮 witchsky.app
bluesky fork client
119
fork

Configure Feed

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

at a876aae44ea07494ebea9727350aa060b81f317b 30 lines 696 B view raw
1import {AppBskyRichtextFacet, type RichText} from '@atproto/api' 2 3import {linkRequiresWarning} from './url-helpers' 4 5export function richTextToString(rt: RichText, loose: boolean): string { 6 const {text, facets} = rt 7 8 if (!facets?.length) { 9 return text 10 } 11 12 let result = '' 13 14 for (const segment of rt.segments()) { 15 const link = segment.link 16 17 if (link && AppBskyRichtextFacet.validateLink(link).success) { 18 const href = link.uri 19 const text = segment.text 20 21 const requiresWarning = linkRequiresWarning(href, text) 22 23 result += !requiresWarning ? href : loose ? `[${text}](${href})` : text 24 } else { 25 result += segment.text 26 } 27 } 28 29 return result 30}