Open resistdesign opened 9 years ago
Seems to be an issue when running node 0.11.x.
Looks like most of the unit tests fails under Node 0.11.x with similar symtom (child nodes missing or truncated). Primary suspect is HTML parser or DOM implementation modules because html2jade outputs what it sees.
any updates on this
just tried with same result which is not surprising since jsdom-little
hasn't changed.
do have to run html2jade under node 0.11.x?
I am trying to use this in latest chrome which I suppose has the latest node
sorry but chrome, the browser, does not have node.js inside of it.
with atom it does
Yes, Atom uses both Chrome and Node.js.
Have you tried running html2jade in the browser? See Programmatic Usage section of the README.md file for example. If you're using tools like browserify, you'll need to add jsdom-little
module to the tool's list of modules to ignore.
TO THOSE WHO ABSOLUTELY NEED TO RUN HTML2JADE UNDER 0.11:
Try forking and replacing jsdom-lite
dependency with jsdom
. According to @zxdong262, this makes html2jade run under 0.11.x. Thx.
How about then switching away from jsdom-little
completely and head over https://github.com/cheeriojs/cheerio?
Cheerio is definitely an option since jsdom-little
appears to be abandoned. Only problem is I don't have a desperate need since I can just switch to Node.js 0.10 or use one of several web version. In other words, PR is welcome as long as backward compatibility is maintained to minimize backfire. :-)
Working in a PR. Is there are use case when the library is used outside the Node.js context? Since there are things like this:
if module?
isNode = true
Ah, yes, three AFAIK: bower, browserify, scalate. there might be other browser use-cases that could break.
BTW, let me know if you'd like to be added as a collaborator. This project needs someone would could give it more TLC.
Sorry for the silence.
Given the above requirements, it would seem that Cheerio is not the way to go then. I started looking at taking the latest jsdom 3.x in use, since 4.x is only for io.js.
yeah. that was my conclusion last time I looked at Cheerio.
For anybody who want to run it on 0.11 or 0.12, you can use my fork for the time being. I just changed jsdom-little
to jsdom
dependency.
https://github.com/donpark/html2jade/pull/100
"dependencies": {
"html2jade": "Nedomas/html2jade"
}
Verified that html2jade works with Node.js v4. Reducing bug level to minor.
When supplying a file that has a DIV as the outer most element I only get the DIV in the jade file and not any of it's children.