donpark / html2jade

Converts HTML to Jade template. Not perfect but useful enough for non-daily conversions.
MIT License
1.18k stars 156 forks source link

Optional dependency on Contextify is broken #39

Closed neersighted closed 12 years ago

neersighted commented 12 years ago

The optional (why optional!?) dependency on Contextify will break the whole program if Contextify fails to install, IE:

┌─[neer@neersighted:pts/6]-[~ | none:none()]-[18:31 | Fri, Jul 20, 2012]----[5861]
└─[±] html2jade http://twitter.com

/usr/local/lib/node_modules/html2jade/node_modules/jsdom/lib/jsdom.js:171
    features   = JSON.parse(JSON.stringify(window.document.implementation._fea
                                                          ^
TypeError: Cannot read property 'implementation' of undefined
    at exports.env.exports.jsdom.env.processHTML (/usr/local/lib/node_modules/html2jade/node_modules/jsdom/lib/jsdom.js:171:59)
    at Request.exports.env.exports.jsdom.env [as _callback] (/usr/local/lib/node_modules/html2jade/node_modules/jsdom/lib/jsdom.js:276:9)
    at Request.init.self.callback (/usr/local/lib/node_modules/html2jade/node_modules/jsdom/node_modules/request/main.js:120:22)
    at Request.EventEmitter.emit (events.js:91:17)
    at Request.<anonymous> (/usr/local/lib/node_modules/html2jade/node_modules/jsdom/node_modules/request/main.js:555:16)
    at Request.EventEmitter.emit (events.js:88:17)
    at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/usr/local/lib/node_modules/html2jade/node_modules/jsdom/node_modules/request/main.js:517:14)
    at IncomingMessage.EventEmitter.emit (events.js:115:20)
    at IncomingMessage._emitEnd (http.js:366:10)
    at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)

Maybe the dependency should be required absolutely?

donpark commented 12 years ago

Sorry but html2jade does not depend directly on contextify (jsdom does).

Are you using Windows? Contextify is, last time I checked, not available on Windows.

You might want to give this web-version a try: http://html2jade.aaron-powell.com/

neersighted commented 12 years ago

No, tested this both on Ubuntu and Debian.

neersighted commented 12 years ago

(I'll go bug the jsdom people then.)

donpark commented 12 years ago

Good. :-) BTW, I noticed that jsdom has entry for contextify in both dependencies and optionalDependencies sections. Something is not right.