Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: get markdown image from backend (#581)

Zeng1998e1e5121dd77c
diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsx
index 9708aa628..a604d1e39 100644
--- a/web/src/components/Memo.tsx
+++ b/web/src/components/Memo.tsx
@@ -146,10 +146,12 @@ const Memo: React.FC<Props> = (props: Props) => {
const imageUrls =
memo.content.match(/!\[.*?\]\((.*?)\)/g)?.map(
(item) =>
- item
- .match(/\((.*?)\)/g)
- ?.slice(-1)[0]
- .slice(1, -1) ?? ""
+ `/o/get/image?url=${
+ item
+ .match(/\((.*?)\)/g)
+ ?.slice(-1)[0]
+ .slice(1, -1) ?? ""
+ }`
) ?? [];
showPreviewImageDialog(
imageUrls,