-
Notifications
You must be signed in to change notification settings - Fork 44
Description
Bug description
When previewing a (q)md file that has a space in the name using the "preview" icon in the vs code editor, the opened preview url is truncated at the first space.
E.g. http://localhost:7278/Draft/13 About [17].html
becomes http://localhost:7278/Draft/13
This seems to be the same issue as #240.
While the commit that closed #240 (421e4f9) introduces a more robust regex (that correctly matches the above example), it seems to fall back to previewCommandUrl_ matched with kLocalPreviewRegex in apps/vscode/src/providers/preview/preview.ts
This only happens when using a quarto project. Rendering an individual file without _quarto.yml present works.
Presumably this is the cause because for individual files the preview url is just host:port
without a path.
Steps to reproduce
- Create an empty folder.
- Create a _quarto.yml file with minimal content for a project:
project: type: default
- Create a subfolder "Draft".
- In that folder, create a qmd file with a space in it's name, e.g.
13 About [17].qmd
- Click the preview button
- Observe that quarto preview prints the correct url in the terminal
- Observe that the actual preview browser opened navigates to
http://localhost:<port>/Draft/13
Actual behavior
The preview browser opens http://localhost:<port>/Draft/13
Expected behavior
The preview browser opens http://localhost:<port>/Draft/13 About [17].html
Your environment
- VSCode 1.105.1
- Windows 11
- Quarto extension version 1.126.0