Closed SherkeyXD closed 3 months ago
I think this is a basic that you should use the latest v2 before opening any issues.
Hello @SherkeyXD. This issue is marked as invalid
and closed. Please follow the issue template.
I've already tested locally with the newest version when writing this issue, and the problem still exists. Here are the dependencies in my local machine.
"devDependencies": {
"@vuepress/bundler-vite": "2.0.0-rc.14",
"@vuepress/plugin-docsearch": "2.0.0-rc.40",
"@vuepress/plugin-google-analytics": "2.0.0-rc.37",
"@vuepress/plugin-shiki": "^2.0.0-rc.40",
"markdown-it": "^14.1.0",
"markdown-it-anchor": "^9.0.1",
"vue": "^3.4.33",
"vuepress": "2.0.0-rc.14",
"vuepress-theme-hope": "2.0.0-rc.52"
},
And the commit 7e56412 first appears in v2.0.0-rc.39, which is just the deployed version.
The problem is that the MouseEvent
event and keydown
event result in different base paths.
In v2.0.0-rc.38 they are the same.
Edit: the href is correct, so the problem should be the keydown
event.
Then you should provide a reproducion
Description
When the base is not the root, like
/docs
, something weird is happening. Left click the search result, you got the right base, like/docs
. However, if you press enter, the base is repeated twice, like/docs/docs
.I think this maybe be related to 7e56412, where two different bases appear.
https://github.com/vuepress/ecosystem/blob/2a4768d1391b22570190d39a0a1a7730fc752e58/plugins/search/plugin-docsearch/src/client/composables/useDocsearchShim.ts#L31
https://github.com/vuepress/ecosystem/blob/2a4768d1391b22570190d39a0a1a7730fc752e58/plugins/search/plugin-docsearch/src/client/composables/useDocsearchShim.ts#L50
One is
__DOCSEARCH_INDEX_BASE__
, and the other is__VUEPRESS_BASE__
.Reproduction
https://github.com/MaaAssistantArknights/MaaAssistantArknights/tree/dev/docs
Used Package Manager
pnpm
System Info