fix: Account for multiple images on the same line of text when converting images for public share

closes #1602
This commit is contained in:
Tom Moor
2020-10-21 20:22:23 -07:00
parent 34bdc88003
commit a9c05adc3c

View File

@ -8,7 +8,7 @@ type Options = {
isPublic?: boolean,
};
const attachmentRegex = /!\[.*\]\(\/api\/attachments\.redirect\?id=(?<id>.*)\)/gi;
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;
// replaces attachments.redirect urls with signed/authenticated url equivalents
async function replaceImageAttachments(text) {