Skip to content

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

Description

@kidneyhex

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions