Skip to content

Commit

Permalink
Fix absolute paths in markdown preview on windows
Browse files Browse the repository at this point in the history
Fixes #84728

We should use `.fsPath` for both parts of the uri in this case.
  • Loading branch information
mjbvz committed Dec 3, 2019
1 parent eae6eca commit 9785578
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions extensions/markdown-language-features/src/markdownEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,11 @@ export class MarkdownEngine {
if (uri.path[0] === '/') {
const root = vscode.workspace.getWorkspaceFolder(this.currentDocument!);
if (root) {
uri = uri.with({
path: path.join(root.uri.fsPath, uri.path),
const fileUri = vscode.Uri.file(path.join(root.uri.fsPath, uri.fsPath));
uri = fileUri.with({
scheme: uri.scheme,
fragment: uri.fragment,
query: uri.query,
});
}
}
Expand Down

0 comments on commit 9785578

Please sign in to comment.