refacto: use microcosm endpoint and change types
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
export const withATProtoImages = (
|
||||
markdown: string,
|
||||
{ endpoint, did }: { endpoint: string; did: string },
|
||||
{ pds, did }: { pds: string; did: string },
|
||||
): string => {
|
||||
const imageLinkPattern = /!\[([^\]]*)\]\((bafkrei[a-z0-9]+)\)/g
|
||||
|
||||
return markdown.replace(imageLinkPattern, (_, altText, cid) => {
|
||||
const imageUrl = new URL("/xrpc/com.atproto.sync.getBlob", endpoint)
|
||||
const imageUrl = new URL("/xrpc/com.atproto.sync.getBlob", pds)
|
||||
imageUrl.searchParams.set("did", did)
|
||||
imageUrl.searchParams.set("cid", cid)
|
||||
return `})`
|
||||
|
||||
Reference in New Issue
Block a user