diff --git a/CHANGELOG.md b/CHANGELOG.md index e0a20f23..5538f9e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [1.16.0] - 2020-05-27 + +- Fix for Node.js v14.16.0 + ## [1.16.0] - 2020-05-04 - Add all front matter properties as an argument for custom scripts diff --git a/src/viewpanel/index.tsx b/src/viewpanel/index.tsx index 527cdbb7..e2afdfb9 100644 --- a/src/viewpanel/index.tsx +++ b/src/viewpanel/index.tsx @@ -9,4 +9,4 @@ declare const acquireVsCodeApi: () => { }; const elm = document.querySelector("#app"); -render(, elm); \ No newline at end of file +render(, elm); diff --git a/src/webview/ExplorerView.ts b/src/webview/ExplorerView.ts index 2985f8a2..2d46011a 100644 --- a/src/webview/ExplorerView.ts +++ b/src/webview/ExplorerView.ts @@ -187,7 +187,12 @@ export class ExplorerView implements WebviewViewProvider, Disposable { if (wsFolders && wsFolders.length > 0) { const wsPath = wsFolders[0].uri.fsPath; - exec(`${customScript.nodeBin || "node"} ${path.join(wsPath, msg.data.script)} "${wsPath}" "${editor?.document.uri.fsPath}" "${JSON.stringify(article?.data)}"`, (error, stdout) => { + let articleData = `'${JSON.stringify(article?.data)}'`; + if (os.type() === "Windows_NT") { + articleData = `"${JSON.stringify(article?.data).replace(/"/g, `""`)}"`; + } + + exec(`${customScript.nodeBin || "node"} ${path.join(wsPath, msg.data.script)} "${wsPath}" "${editor?.document.uri.fsPath}" ${articleData}`, (error, stdout) => { if (error) { window.showErrorMessage(`${msg?.data?.title}: ${error.message}`); return;