mirror of
https://github.com/outline/outline.git
synced 2026-12-01 01:14:11 +03:00
8 lines
313 B
TypeScript
8 lines
313 B
TypeScript
const attachmentRegex = /!\[.*?\]\(\/api\/attachments\.redirect\?id=(?<id>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\)/gi;
|
|
|
|
export default function parseAttachmentIds(text: any): string[] {
|
|
return [...text.matchAll(attachmentRegex)].map(
|
|
(match) => match.groups && match.groups.id
|
|
);
|
|
}
|