diff --git a/src/components/Markdown.tsx b/src/components/Markdown.tsx index 7ff8019b6f..4020e87641 100644 --- a/src/components/Markdown.tsx +++ b/src/components/Markdown.tsx @@ -184,6 +184,10 @@ export function Markdown(props: { content = content.replace(/!\[.*?\]\((.*?)\)/g, (match) => { const name = match.match(/!\[(.*?)\]\(.*?\)/)![1] let url = match.match(/!\[.*?\]\((.*?)\)/)![1] + // 检查是否为 base64 编码的图片 + if (url.startsWith("data:image/")) { + return match // 如果是 base64 编码的图片,直接返回原标签 + } if ( url.startsWith("http://") || url.startsWith("https://") ||