diff --git a/package.json b/package.json index e900516..c0147d7 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Corgea", "publisher": "Corgea", "description": "Corgea helps you automatically fix insecure code.", - "version": "1.5.2", + "version": "1.5.3", "icon": "images/logo.png", "license": "UNLICENSED", "repository": { diff --git a/src/providers/vulnerabilitiesWebviewProvider.ts b/src/providers/vulnerabilitiesWebviewProvider.ts index 0a97df3..8eb2fbe 100644 --- a/src/providers/vulnerabilitiesWebviewProvider.ts +++ b/src/providers/vulnerabilitiesWebviewProvider.ts @@ -405,6 +405,10 @@ export default class VulnerabilitiesWebviewProvider implements vscode.WebviewVie }); } + private _safeJsonStringify(value: any): string { + return JSON.stringify(value).replace(//g, '\\u003e'); + } + private _getReactHtmlTemplate(data: any): string { return ` @@ -420,33 +424,30 @@ export default class VulnerabilitiesWebviewProvider implements vscode.WebviewVie
- + `; } diff --git a/src/views/entry/SidePanelView.tsx b/src/views/entry/SidePanelView.tsx index 3a20ebf..fc6b24a 100644 --- a/src/views/entry/SidePanelView.tsx +++ b/src/views/entry/SidePanelView.tsx @@ -6,6 +6,16 @@ import VulnerabilitiesApp from '../components/VulnerabilitiesApp/Vulnerabilities // Global styles import '../styles/global.css'; +declare function acquireVsCodeApi(): { + postMessage: (message: any) => void; + getState: () => any; + setState: (state: any) => void; +}; + +if (typeof acquireVsCodeApi !== 'undefined' && !window.vscode) { + window.vscode = acquireVsCodeApi(); +} + const container = document.getElementById('app'); if (!container) { throw new Error('Root container not found');