提交 03da6308 编写于 作者: M Matt Bierner

Make sure id is explicitly used as authority when rewritting vscode-resource: uris

上级 6d7b8db4
......@@ -390,13 +390,13 @@ export class ElectronWebviewBasedWebview extends BaseWebview<WebviewTag> impleme
return value
.replace(/(["'])vscode-resource:(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi, (match, startQuote, _1, scheme, path, endQuote) => {
if (scheme) {
return `${startQuote}${Schemas.vscodeWebviewResource}:${this.id}/${scheme}${path}${endQuote}`;
return `${startQuote}${Schemas.vscodeWebviewResource}://${this.id}/${scheme}${path}${endQuote}`;
}
if (!path.startsWith('//')) {
// Add an empty authority if we don't already have one
path = '//' + path;
}
return `${startQuote}${Schemas.vscodeWebviewResource}:${this.id}/file${path}${endQuote}`;
return `${startQuote}${Schemas.vscodeWebviewResource}://${this.id}/file${path}${endQuote}`;
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册