The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

428568 (3) [Avatar] Offline
#1
Firstly, [list]the file name should not be `./lib/mian.js` but be `./lib/active-file.js`.

Secondly, in line 15 of the following code:

saveHtml () {
    // Render the content in Markdown as HTML using the Marked library
    const html = marked(this.content, { sanitize: true })

    const file = dialog.showSaveDialog(this.browserWindow, {
      title: 'Save HTML',
      // Default to the user's "documents" directory as defined by the operating system.
      defaultPath: app.getPath('documents'),
      filters: [
        { name: 'HTML Files', extensions: ['html'] }
      ]
    })

    // If the user selects cancel in the file dialog, abort the function.
    if (!this.file) { return }

    fs.writeFileSync(file, html)
  }


if (!this.file) 
should be
if (!file)
Steve Kinney (33) [Avatar] Offline
#2
Thanks again! Fixed in the manuscript now!