Skip to content

Commit

Permalink
fix: avoid to reuse virtual console
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats authored Feb 17, 2020
1 parent c8a3b51 commit eec0404
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/metascraper-readability/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ const { memoizeOne, composeRule } = require('@metascraper/helpers')
const Readability = require('readability')
const jsdom = require('jsdom')

const { JSDOM } = jsdom

const virtualConsole = new jsdom.VirtualConsole()
const { JSDOM, VirtualConsole } = jsdom

const readability = memoizeOne(($, url) => {
const dom = new JSDOM($.html(), { virtualConsole, url })
const dom = new JSDOM($.html(), { url, virtualConsole: new jsdom.VirtualConsole() })
const reader = new Readability(dom.window.document)
return reader.parse()
})
Expand Down

0 comments on commit eec0404

Please sign in to comment.