From d5290c3cfc48ef1a63929081ef73056bb0c1fc8e Mon Sep 17 00:00:00 2001 From: ssdfasd <2156608475@qq.com> Date: Wed, 18 Mar 2026 13:46:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=9B=B8=E5=AF=B9?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=20@see=20=E9=93=BE=E6=8E=A5=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ApiDocViewer.tsx | 2 +- src/components/DocContent.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ApiDocViewer.tsx b/src/components/ApiDocViewer.tsx index eb53a56..77c4ac3 100644 --- a/src/components/ApiDocViewer.tsx +++ b/src/components/ApiDocViewer.tsx @@ -46,7 +46,7 @@ export const ApiDocViewer = () => { }, []) const handleReferenceClick = useCallback((ref: string) => { - const normalizedRef = ref.replace('.md', '') + const normalizedRef = ref.replace('.md', '').replace(/^\.\.\//, '') const allFiles = Object.keys(DOCS_FILES) const match = allFiles.find(f => f.replace('.md', '') === normalizedRef) if (match) { diff --git a/src/components/DocContent.tsx b/src/components/DocContent.tsx index 0c34207..79425c6 100644 --- a/src/components/DocContent.tsx +++ b/src/components/DocContent.tsx @@ -116,9 +116,9 @@ const Section = ({ section, onReferenceClick }: SectionProps) => { const TextContent = ({ text, onReferenceClick }: { text: string; onReferenceClick: (ref: string) => void }) => { const renderText = () => { - const parts = text.split(/(@see\s+\S+)/g) + const parts = text.split(/(@see\s+[^\s]+)/g) return parts.map((part, idx) => { - const match = part.match(/@see\s+(\S+)/) + const match = part.match(/@see\s+([^\s]+)/) if (match) { return (