Encode filepaths with whitespace in links (#179167)

This commit is contained in:
Joyce Er 2023-04-04 14:27:40 -07:00 committed by GitHub
parent 20aee57124
commit 602c01b268
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ async function copyVscodeDevLink(gitAPI: GitAPI, useSelection: boolean, context:
try {
const permalink = getLink(gitAPI, useSelection, getVscodeDevHost(), 'headlink', context, includeRange);
if (permalink) {
return vscode.env.clipboard.writeText(permalink);
return vscode.env.clipboard.writeText(encodeURI(permalink));
}
} catch (err) {
vscode.window.showErrorMessage(err.message);