From 5a292eb4cb11628defd77761c779de02f96bf1b8 Mon Sep 17 00:00:00 2001 From: Mister-Hope Date: Thu, 9 Jan 2025 23:57:45 +0800 Subject: [PATCH] fix(theme-default): fix resolvePrefix --- themes/theme-default/src/client/utils/resolvePrefix.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/themes/theme-default/src/client/utils/resolvePrefix.ts b/themes/theme-default/src/client/utils/resolvePrefix.ts index 9ad7ccddf3..0b5b0c3372 100644 --- a/themes/theme-default/src/client/utils/resolvePrefix.ts +++ b/themes/theme-default/src/client/utils/resolvePrefix.ts @@ -1,4 +1,10 @@ -import { ensureEndingSlash, isLinkRelative } from '@vuepress/helper/client' +import { + ensureEndingSlash, + isLinkAbsolute, + isLinkWithProtocol, +} from '@vuepress/helper/client' export const resolvePrefix = (prefix = '', path = ''): string => - isLinkRelative(path) ? `${ensureEndingSlash(prefix)}${path}` : path + isLinkAbsolute(path) || isLinkWithProtocol(path) + ? path + : `${ensureEndingSlash(prefix)}${path}`