Skip to content

Commit c1c3e5e

Browse files
committed
Properly encode markdown file path for open links
Fixes microsoft#59523 Double encode the path so that `Uri.parse`'s decoding only strips out the first level of encoding
1 parent 52fb907 commit c1c3e5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extensions/markdown-language-features/src/commands/openDocumentLink.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class OpenDocumentLinkCommand implements Command {
2525
path: string,
2626
fragment: string
2727
): vscode.Uri {
28-
return vscode.Uri.parse(`command:${OpenDocumentLinkCommand.id}?${encodeURIComponent(JSON.stringify({ path, fragment }))}`);
28+
return vscode.Uri.parse(`command:${OpenDocumentLinkCommand.id}?${encodeURIComponent(JSON.stringify({ path: encodeURIComponent(path), fragment }))}`);
2929
}
3030

3131
public constructor(

0 commit comments

Comments
 (0)