提交 a99e510a 编写于 作者: M Matt Bierner

Fixing preprocessHtml to handle old style vscode-resource uris better

上级 f54e4cc6
......@@ -92,9 +92,13 @@ export class IFrameWebview extends BaseWebview<HTMLIFrameElement> implements Web
}
private preprocessHtml(value: string): string {
return value.replace(/(["'])vscode-resource:(\/\/([^\s'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi, (_, startQuote, _1, scheme, path, endQuote) => {
return `${startQuote}${this.externalEndpoint}/vscode-resource/${scheme || ''}${path}${endQuote}`;
});
return value
.replace(/(["'])vscode-resource:(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi, (match, startQuote, _1, scheme, path, endQuote) => {
if (scheme) {
return `${startQuote}${this.externalEndpoint}/vscode-resource/${scheme}${path}${endQuote}`;
}
return `${startQuote}${this.externalEndpoint}/vscode-resource/file${path}${endQuote}`;
});
}
protected get extraContentOptions() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册