Open takahiro-ngc opened 3 months ago
System: OS: Windows 11 10.0.22631 CPU: (8) x64 AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx Memory: 973.03 MB / 6.94 GB Browsers: Edge: Chromium (126.0.2592.113) Internet Explorer: 11.0.22621.1 npmPackages: rspress: ^1.26.1 => 1.26.2
When creating links to files in MD or MDX files, rspress incorrectly processes the href attributes, causing two issues:
For example, in /docs/guide/index.md:
[aaa](./aaa.pdf)
[bbb](./bbb.png)
Expected output in generated HTML:
href="/guide/aaa.pdf"
href="/guide/bbb.png"
Actual output in generated HTML:
href="/guide/aaa.pdf.html"
href="/./bbb.png.html"
https://codesandbox.io/p/devbox/silly-sky-qg9smt?file=%2Fdocs%2Fguide%2Findex.md%3A6%2C1&workspaceId=ba5b3bb4-c28a-4756-b043-8178f97ca28d
[File Link](./document.pdf)
[Image Link](./image.png)
https://rspress.dev/guide/basic/static-assets#static-assets-used-in-mdx-files
You should use ![Image Link](./image.png), [Image Link](./image.png) means it is a link contain .png instead of assets.
![Image Link](./image.png)
.png
Version
Details
When creating links to files in MD or MDX files, rspress incorrectly processes the href attributes, causing two issues:
For example, in /docs/guide/index.md:
[aaa](./aaa.pdf)
[bbb](./bbb.png)
Expected output in generated HTML:
href="/guide/aaa.pdf"
href="/guide/bbb.png"
Actual output in generated HTML:
href="/guide/aaa.pdf.html"
href="/./bbb.png.html"
Reproduce link
https://codesandbox.io/p/devbox/silly-sky-qg9smt?file=%2Fdocs%2Fguide%2Findex.md%3A6%2C1&workspaceId=ba5b3bb4-c28a-4756-b043-8178f97ca28d
Reproduce Steps
[File Link](./document.pdf)
[Image Link](./image.png)