From a9c05adc3c0fcb1a60d14422d30f494e15663e8f Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 21 Oct 2020 20:22:23 -0700 Subject: [PATCH] fix: Account for multiple images on the same line of text when converting images for public share closes #1602 --- server/presenters/document.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/presenters/document.js b/server/presenters/document.js index c459db85..fbf46566 100644 --- a/server/presenters/document.js +++ b/server/presenters/document.js @@ -8,7 +8,7 @@ type Options = { isPublic?: boolean, }; -const attachmentRegex = /!\[.*\]\(\/api\/attachments\.redirect\?id=(?.*)\)/gi; +const attachmentRegex = /!\[.*?\]\(\/api\/attachments\.redirect\?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) {