diff --git a/web/app/components/base/markdown.tsx b/web/app/components/base/markdown.tsx
index 52b880affa..6ea84a2842 100644
--- a/web/app/components/base/markdown.tsx
+++ b/web/app/components/base/markdown.tsx
@@ -252,7 +252,7 @@ const Img = ({ src }: any) => {
return
}
-const Link = ({ node, ...props }: any) => {
+const Link = ({ node, children, ...props }: any) => {
if (node.properties?.href && node.properties.href?.toString().startsWith('abbr')) {
// eslint-disable-next-line react-hooks/rules-of-hooks
const { onSend } = useChatContext()
@@ -261,7 +261,7 @@ const Link = ({ node, ...props }: any) => {
return onSend?.(hidden_text)} title={node.children[0]?.value}>{node.children[0]?.value}
}
else {
- return {node.children[0] ? node.children[0]?.value : 'Download'}
+ return {children || 'Download'}
}
}