fix(theme): fix parsing error for relative path link (#779)

This commit is contained in:
pengzhanbo 2025-12-05 17:16:48 +08:00 committed by GitHub
parent 9b2b73e05b
commit 07710247bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,7 +64,8 @@ export function useLink(
// 判断是否为不存在的路由
const routePath = link.split(/[?#]/)[0]
const { notFound } = resolveRoute(routePath)
const currentPath = page.value.filePathRelative ? `/${page.value.filePathRelative}` : undefined
const { notFound } = resolveRoute(routePath, currentPath)
if (__VUEPRESS_DEV__)
notFound && console.warn(`[VuePress Dead Link] "${toValue(href)}" is not found in (${page.value.filePathRelative || page.value.path})`)