Skip to content

Commit

Permalink
Properly encode markdown file path for open links
Browse files Browse the repository at this point in the history
Fixes #59523

Double encode the path so that `Uri.parse`'s decoding only strips out the first level of encoding
  • Loading branch information
mjbvz committed Jan 28, 2019
1 parent 52fb907 commit c1c3e5e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c1c3e5e

Please sign in to comment.