From 0d913ebd943ce6619233ed2818f5115ee6b62ef9 Mon Sep 17 00:00:00 2001 From: xintaofei Date: Tue, 17 Mar 2026 00:35:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=A2=84=E8=A7=88=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/files/file-workspace-panel.tsx | 3 +-- src/components/files/file-workspace-tab-bar.tsx | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/files/file-workspace-panel.tsx b/src/components/files/file-workspace-panel.tsx index 5972ad1..c702f21 100644 --- a/src/components/files/file-workspace-panel.tsx +++ b/src/components/files/file-workspace-panel.tsx @@ -1375,8 +1375,7 @@ export function FileWorkspacePanel() { ), // eslint-disable-next-line @typescript-eslint/no-unused-vars a: ({ node, href, children, ...aProps }) => { - const isRelative = - href && !/^https?:\/\/|^mailto:|^#/.test(href) + const isRelative = href && !/^[a-z][a-z0-9+.-]*:|^#/i.test(href) if (isRelative && href) { return ( openPath(`${folder.path}/${activeTab.path}`)} + onClick={() => { + openPath(`${folder.path}/${activeTab.path}`).catch(() => {}) + }} className="shrink-0 flex items-center justify-center w-10 hover:bg-primary/8 transition-colors" aria-label={t("preview")} title={t("preview")}