Skip to content

Commit

Permalink
Fixed error
Browse files Browse the repository at this point in the history
- Fixed install problem
- Update dependencies
  • Loading branch information
hjleesm committed Jun 29, 2021
1 parent 82d5f23 commit a719785
Show file tree
Hide file tree
Showing 3 changed files with 471 additions and 17 deletions.
25 changes: 13 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
var fs = require('fs')
, vm = require('vm')
, jsdom = require('jsdom')
,vm = require('vm')
,jsdom = require('jsdom')

const { JSDOM } = jsdom;

var script = loadRaphael()
var script = loadRaphael();
module.exports.generate = function generate(width, height, callback) {
var doc = new JSDOM('<html><body></body></html>')
win = doc.window
const JSDOM = jsdom.JSDOM;

var dom = new JSDOM("<html><body></body></html>");
var win = dom.window;
var doc = win.document;

var nav = win.navigator
win.document = doc

// doc.implementation.addFeature(
// "http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")
var paper = extractRaphael(win, win.document, nav)(0, 0, width || 42, height || 42)

if (callback) callback(paper, win.document, nav)
return win.document.body.firstChild && win.document.body.firstChild.outerHTML || ""
paper = extractRaphael(win, doc, nav)(0, 0, width || 42, height || 42)
if (callback) callback(paper)

return doc.body.firstChild && doc.body.firstChild.outerHTML || "";
}

function loadRaphael() {
Expand Down
Loading

0 comments on commit a719785

Please sign in to comment.