microsoft / microsoft/vscode-livepreview
Live Preview generates incorrect directory index URLs using encoded backslashes (%5Cfolder%5Cpath)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 596
- Forks
- 119
- Avg merge
- 1d 4m
- Merged PRs (30d)
- 5
Description
Description
When Live Preview serves a directory index page for a folder, all generated links include percent‑encoded backslashes (%5C) and duplicated path segments. This results in broken URLs such as:
http://127.0.0.1:3000/apps/%5Capps%5Cfolder
Environment
VS Code: 1.134.0
Live Preview: 0.5.2026072301
OS: Windows 11
Workspace structure example
apps/
folder/
anotherfolder/
Steps to reproduce
- Open a workspace containing subfolders under any directory (e.g.,
/apps). - Start Live Preview (
Live Preview: Start Server). - Navigate to the folder index page, e.g.
http://127.0.0.1:3000/apps. - Observe that all links include encoded backslashes and duplicated folder names.
An incorrect result will end up looking like:
<a href="%5Capps%5Cfolder/">folder/</a>
<a href="%5Capps%5Canotherfolder/">anotherfolder/</a>
The expected result (though there could be many ways of formatting):
<a href="./folder/">folder/</a>
<a href="./anotherfolder/">anotherfolder/</a>
Notes:
This appears to be a path‑normalization issue where Windows-style \ separators are encoded instead of converted to /.
Related:
I think these are the same issue, I'm just trying to add more info.
#762
#795
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the directory index on Windows using the workspace structure and URLs described in the issue, then trace the code that generates directory links and normalizes paths. Done means folder links use forward-slash relative URLs such as ./folder/ without encoded backslashes or duplicated segments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100