提交 7a6ed6d5 编写于 作者: M Matt Bierner

Use a regexp that works across browsers

上级 c281e61a
......@@ -172,7 +172,8 @@ export class IFrameWebview extends Disposable implements Webview {
}
private preprocessHtml(value: string): string {
return value.replace(/(?<=["'])vscode-resource:([^\s'"]+)(?=["'])/gi, `${this.environmentService.webviewEndpoint}/vscode-resource$1`);
return value.replace(/(["'])vscode-resource:([^\s'"]+?)(["'])/gi, (_, startQuote, path, endQuote) =>
`${startQuote}${this.environmentService.webviewEndpoint}/vscode-resource${path}${endQuote}`);
}
public update(html: string, options: WebviewContentOptions, retainContextWhenHidden: boolean) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册