-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
Describe the bug
Why is the image link correct but the download link incorrect ?
markdown--> html
Reproduction
Folder situation:
\public\dn\
b.zip
\subdir\
demo.md
a.zip
config.mjs:
export default defineConfig({
title: "xxx系统",
description: "A VitePress Site",
base:'/vp/',
themeConfig: {}
})The content of the file:demo.md
<a href="./a.zip" download> dn</a>
[a.zip](./a.zip){download}
[b.zip](/dn/b.zip){download}
build result:
.vitepress\dist\subdir\
demo.html
a.zip:does not exist
.vitepress\dist\dn\
b.zip,ok,exist
The content of the file:demo.html
<p><a href="./a.zip" download>dn</a></p>
<p><a href="./a.zip" download>a.zip</a></p>
<p><a href="/dn/b.zip" download>b.zip</a></p>Expected behavior
What I hope for is:
1. The file "a.zip" should be copied to ".vitepress\dist\subdir\a.zip"
2. Hyperlinks are built based on the {base}:
<p><a href="/vp/dn/b.zip" down>b.zip</a></p>but The MD below parsing and file copying are both correct:

 //public/img/d.pngto
<p><img src="/vp/assets/c.BbAI9XcS.png" alt="pic"></p>
<p><img src="/vp/img/d.png" alt="pic"></p>My configuration is incomplete or there are bug?
System Info
windows 11,iis
Additional context
No response
Validations
- Check if you're on the latest VitePress version.
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
No labels