From 4c37c04fcc3a22d23f56b674459114f2305653ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Sun, 9 Oct 2022 16:40:04 +0800 Subject: [PATCH] docs: fix getLink logic --- .dumi/hooks/useLocation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dumi/hooks/useLocation.ts b/.dumi/hooks/useLocation.ts index 66e66d72cf..3499a3bbe2 100644 --- a/.dumi/hooks/useLocation.ts +++ b/.dumi/hooks/useLocation.ts @@ -3,7 +3,7 @@ import * as React from 'react'; import useLocale from './useLocale'; function clearPath(path: string) { - return path.replace('-cn', ''); + return path.replace('-cn', '').replace(/\/$/, ''); } export default function useLocation() {