diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsx index 2f4ff850..dc1fc9b1 100644 --- a/web/src/components/Memo.tsx +++ b/web/src/components/Memo.tsx @@ -165,7 +165,14 @@ const Memo: React.FC = (props: Props) => { if (currImgUrl) { // use regex to get all image urls from memo content - const imageUrls = memo.content.match(/!\[.*?\]\((.*?)\)/g)?.map((item) => item.match(/\((.*?)\)/)?.[1] ?? "") ?? []; + const imageUrls = + memo.content.match(/!\[.*?\]\((.*?)\)/g)?.map( + (item) => + item + .match(/\((.*?)\)/g) + ?.slice(-1)[0] + .slice(1, -1) ?? "" + ) ?? []; showPreviewImageDialog( imageUrls, imageUrls.findIndex((item) => item === currImgUrl)