Properly encode markdown file path for open links

Fixes #59523

Double encode the path so that `Uri.parse`'s decoding only strips out the first level of encoding
This commit is contained in:
Matt Bierner
2019-01-28 15:45:30 -08:00
parent 52fb9079e9
commit c1c3e5eab0

View File

@@ -25,7 +25,7 @@ export class OpenDocumentLinkCommand implements Command {
path: string,
fragment: string
): vscode.Uri {
return vscode.Uri.parse(`command:${OpenDocumentLinkCommand.id}?${encodeURIComponent(JSON.stringify({ path, fragment }))}`);
return vscode.Uri.parse(`command:${OpenDocumentLinkCommand.id}?${encodeURIComponent(JSON.stringify({ path: encodeURIComponent(path), fragment }))}`);
}
public constructor(