From 9f08368e92607e3603d8aa3e9583a2dcc5baa6cc Mon Sep 17 00:00:00 2001 From: Habib Karim <3755450+habibkarim@users.noreply.github.com> Date: Fri, 19 Feb 2021 03:07:22 +0000 Subject: [PATCH] Handle normalized absolute file paths on markdown preview link click (#116649) * Handle normalized absolute file paths on markdown preview link click #115812 * Parse file path using vscode.Uri --- extensions/markdown-language-features/src/features/preview.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/markdown-language-features/src/features/preview.ts b/extensions/markdown-language-features/src/features/preview.ts index 9363431f8a2..22c512dbf61 100644 --- a/extensions/markdown-language-features/src/features/preview.ts +++ b/extensions/markdown-language-features/src/features/preview.ts @@ -439,6 +439,9 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider { if (hrefPath[0] !== '/') { // Fix #93691, use this.resource.fsPath instead of this.resource.path hrefPath = path.join(path.dirname(this.resource.fsPath), hrefPath); + } else { + // Handle any normalized file paths + hrefPath = vscode.Uri.parse(hrefPath.replace('/file', '')).fsPath; } const config = vscode.workspace.getConfiguration('markdown', this.resource);