microsoft / microsoft/vscode-livepreview

Live Preview generates incorrect directory index URLs using encoded backslashes (%5Cfolder%5Cpath)

Open
#855 0 comments 1 reaction 0 assignees View on GitHub

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

  1. Open a workspace containing subfolders under any directory (e.g., /apps).
  2. Start Live Preview (Live Preview: Start Server).
  3. Navigate to the folder index page, e.g. http://127.0.0.1:3000/apps.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.