Skip to content

Commit

Permalink
Fix export to docx fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
cweijan committed Sep 21, 2023
1 parent 776632c commit c243e1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/service/markdown/html-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export async function exportHtml(exportFilePath, data) {

export async function exportDocx(exportFilePath, data) {
console.log("[pretty-md-pdf] Exported to file: " + exportFilePath)
const exportTask = require("vscode-html-to-docx")(data, '', {}, '');
fs.writeFileSync(exportFilePath, await exportTask)
const exportTask = await require("vscode-html-to-docx")(data, '', {}, '');
const buffer = Buffer.from(await exportTask.arrayBuffer());
fs.writeFileSync(exportFilePath, buffer)
}

/*
Expand Down

0 comments on commit c243e1f

Please sign in to comment.