This commit is contained in:
Hk-Gosuto 2024-02-12 22:10:31 +08:00
parent c8b7378b70
commit 8691e95f12

View File

@ -519,6 +519,7 @@ export function ImagePreviewer(props: {
const updatedContent = markdownContent.replace(
/!\[.*?\]\((.*?)\)/g,
(match, url) => {
if (!url.startsWith("http")) return `![image](${url})`;
const updatedURL = `/api/cors?url=${encodeURIComponent(url)}`;
return `![image](${updatedURL})`;
},