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
This commit is contained in:
Habib Karim 2021-02-19 03:07:22 +00:00 committed by GitHub
parent 094777f392
commit 9f08368e92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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