antfu / vite-plugin-md

Markdown with Vue for Vite
MIT License
604 stars 89 forks source link

bug in parse markdown file relative path #131

Open maxbitcoin opened 1 year ago

maxbitcoin commented 1 year ago

Describe the bug

markdown file in child folder can't be visit correctly.

just use official example

step 1:

add a folder "sub", add two files named "1.md" and "2.md" file structer

step 2:

add link to "1.md" index

step 3:

add content of "1.md" 1

step 4:

add content of "2.md" 2

step 5:

the correct result should be <a href="/sub/2" class="internal-link router-link">2</a> rather than <a href="/2" class="internal-link router-link">2</a> parsed

Reproduction

read "Describe the bug"

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (4) x64 Intel(R) Core(TM) i5-3437U CPU @ 1.90GHz
    Memory: 5.93 GB / 15.87 GB
  Binaries:
    Node: 18.12.1 - D:\Program Files\nodejs\node.EXE     
    Yarn: 1.22.19 - F:\store\npm\global\yarn.CMD
    npm: 8.19.2 - D:\Program Files\nodejs\npm.CMD        
  Browsers:
    Internet Explorer: 11.0.19041.1
    Chrome: 106.0.5249.62

Used Package Manager

pnpm

Validations