提交 06e72b84 编写于 作者: M Matt Bierner

Fix markdown preview file links with spaces

Fixes #44817
上级 0752d71c
......@@ -33,11 +33,12 @@ export class OpenDocumentLinkCommand implements Command {
) { }
public execute(args: OpenDocumentLinkArgs) {
return this.tryOpen(args.path, args).catch(() => {
if (path.extname(args.path) === '') {
return this.tryOpen(args.path + '.md', args);
const p = decodeURIComponent(args.path);
return this.tryOpen(p, args).catch(() => {
if (path.extname(p) === '') {
return this.tryOpen(p + '.md', args);
}
const resource = vscode.Uri.file(args.path);
const resource = vscode.Uri.file(p);
return Promise.resolve(void 0)
.then(() => vscode.commands.executeCommand('vscode.open', resource))
.then(() => void 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册