fix: 自定义编辑器 url 异常
This commit is contained in:
parent
15d8d20b07
commit
7ca40bea6d
|
@ -2,7 +2,7 @@ import { APIMessageItem } from '@ibiz/vscode-editor-api';
|
|||
import { CancellationToken, CustomTextEditorProvider, Disposable, ExtensionContext, TextDocument, Uri, ViewColumn, Webview, WebviewPanel, window } from 'vscode';
|
||||
import { ctx } from '../../context';
|
||||
import { PSMosFile } from '../../entities';
|
||||
import { getPackageJson, notNilEmpty } from '../../util';
|
||||
import { notNilEmpty } from '../../util';
|
||||
|
||||
/**
|
||||
* 自定义文本编辑器基类
|
||||
|
@ -63,17 +63,6 @@ export abstract class CustomEditorBase implements CustomTextEditorProvider {
|
|||
protected abstract getHtmlForWebview(_document: TextDocument, _webview: Webview): string;
|
||||
|
||||
protected getIframeElement(href: string): string {
|
||||
const json = getPackageJson();
|
||||
const version = json.version;
|
||||
if (href.indexOf('?') !== -1) {
|
||||
if (href.endsWith('&')) {
|
||||
href = `${href}v=${version}`;
|
||||
} else {
|
||||
href = `${href}&v=${version}`;
|
||||
}
|
||||
} else {
|
||||
href = `${href}?v=${version}`;
|
||||
}
|
||||
return `<iframe id='iframe' src='${href}' frameborder='0' style='width:100%;height:100%;'></iframe>`;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue