Fix absolute paths in markdown preview on windows

Fixes #84728

We should use `.fsPath` for both parts of the uri in this case.
This commit is contained in:
Matt Bierner 2019-12-02 19:45:07 -08:00
parent eae6eca8cf
commit 97855786a0

View file

@ -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,
});
}
}