提交 94a00a31 编写于 作者: M Matt Bierner

Handle new style vscode-resource paths for iframe based webviews on desktop

Fixes #81847
上级 56304bd6
......@@ -187,8 +187,9 @@ export class IFrameWebview extends Disposable implements Webview {
}
private preprocessHtml(value: string): string {
return value.replace(/(["'])vscode-resource:([^\s'"]+?)(["'])/gi, (_, startQuote, path, endQuote) =>
`${startQuote}${this.externalEndpoint}/vscode-resource/file${path}${endQuote}`);
return value.replace(/(["'])vscode-resource:(\/\/([^\s'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi, (_, startQuote, _1, scheme, path, endQuote) => {
return `${startQuote}${this.externalEndpoint}/vscode-resource/${scheme || ''}${path}${endQuote}`;
});
}
private doUpdateContent() {
......@@ -311,7 +312,7 @@ export class IFrameWebview extends Disposable implements Webview {
return this._send('did-load-resource', {
status: 404,
path: uri.path
path: requestPath
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册