Files
discord-decomp/modules/markup/MarkupAttachmentLinkRule.tsx
T
2026-11-01 12:12:55 +02:00

25 lines
754 B
TypeScript

// Metro module 4633 (f4634).
import Module3888 from "../../_bundle/Module3888";
let c2828_0 = /^https:\/\/(?:(?:media|images)\.discordapp\.net|(?:cdn\.discordapp\.com))\/(?:attachments|ephemeral-attachments)\/\d+\/\d+\/([A-Za-z0-9._-]*[A-Za-z0-9_-])(?:[?][a-zA-Z0-9?&=_-]*)?/;
const r23 = {
attachmentLink: {
order: Module3888.defaultRules.url.order - 0.5,
requiredFirstCharacters: ["h"],
match: (a0) => c2828_0.exec(a0),
parse: (a0) => {
const attachmentUrl = a0[0];
const attachmentName = a0[1];
return {
type: "attachmentLink",
content: [{
type: "text",
content: attachmentName
}],
attachmentUrl,
attachmentName
};
}
}
};
export default r23;