From de866d617b3a19d84bb6f9233e9f35c4c1fe1085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E6=9D=91=E6=8B=93=E6=9C=97=E3=81=AE=E3=82=A2?= =?UTF-8?q?=E3=83=97=E3=83=AA?= Date: Mon, 23 Feb 2026 13:59:40 +0900 Subject: [PATCH] fix(markdown): handle mailto: links without target="_blank" to allow email client to open ## Summary When mailto: links are rendered in chat responses, clicking them does not open the email client because the Link component adds target="_blank" to all valid URLs including mailto: links. With target="_blank", browsers attempt to open a new tab for mailto: links, which results in a blank tab or nothing happening instead of launching the default email client. ## Changes Added a check for mailto: links before the default target="_blank" rendering. mailto: links are now rendered as plain tags without target="_blank", allowing the browser to properly handle the mailto: protocol and open the user's default email client. Related: #12954 #16243 --- web/app/components/base/markdown-blocks/link.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/app/components/base/markdown-blocks/link.tsx b/web/app/components/base/markdown-blocks/link.tsx index 717352609fe..ae92392aa2e 100644 --- a/web/app/components/base/markdown-blocks/link.tsx +++ b/web/app/components/base/markdown-blocks/link.tsx @@ -36,6 +36,10 @@ const Link = ({ node, children, ...props }: any) => { if (!href || !isValidUrl(href)) return {children} + // Handle mailto: links without target="_blank" to allow email client to open directly + if (href.toString().startsWith('mailto:')) + return {children} + return {children || 'Download'} } }