Comments (4)
Hi
Not sure why you would want to do this. Have you got a problem with the current DOM parsing?
The parseDom function structure comes from using https://github.com/cheeriojs/cheerio I picked this parser rather than https://github.com/tmpvar/jsdom because its was noticeable faster and handle more real world web pages without issue. Yes its more jQuery-like (which I do not like), but in tests it works faster with less issues. I think a lot of this is down to it using the more forgiving htmlparser2 code.
I would add that some of the architectural structure of microformat-node is based on a couple of generations of older JavaScript microformat parsers some browser based. So microformat-node could now be refactored into a more terse codebase and use modern JS patterns, but I think thats different from what you are suggesting?
If you could explain a little more what we would gain from the changes I could comment some more.
from microformat-node.
Problem 1: (why I want to add support for jsdom):
I already have a project using jsdom and want to add microfomat support.
I can't use cheerio because it doesn't provides DOM API (it's W3C standard at last).
I've not yet hit any page that jsdom can't parse.
I've not really tested parsing speed, but nowadays network still slower than CPU.
Problem 2: (why I mentioned function names):
Not even cheerio readme names their API a DOM. DOM means some specific API. So if some function has Dom in it's name somebody like me concludes that it accepts of produces objects that supports this specific API.
If you think that there are too match already-existing code that uses this particular function, I think that something like parseW3CDOM()
would be clear for user. Is it sounds well for you?
from microformat-node.
I have an idea - load jQuery using jsdom and pass window.jQuery
to parseDom()
. What should be second argument (as jQuery has no $.root()
)? What else non-compatible functions of cheerio used?
from microformat-node.
Hi I have rebuilt the library still using cheerio, but is now based on the https://github.com/glennjones/microformat-shiv project. If you want to use jsdom
I would I inject microformat-shiv
and use its get
method. This should work the same as using the current version of this project as they share most of the same code.
from microformat-node.
Related Issues (20)
- Error when parsing http://www.boemiadigital.com/
- Error when parsing 'http://www.limitedtoendodontics.com'
- Error when parsing www.markgordondentistry.com HOT 1
- Parsing an h-entry with a root of <article> results in an empty h-entry HOT 3
- parseUrl promise not working HOT 2
- p-name breaks on empty text HOT 5
- Remove or separate out parseUrl() to slim down library? HOT 4
- Can't find '../test/testWriter.js' from bin/microformat-node HOT 2
- HTML entity handling HOT 3
- Update microformat-shiv dependency reference HOT 1
- Regression in text parsing of weird XSS:ish content?
- crash on certain input HOT 2
- crash on certain markup HOT 7
- Truncated Dates (bday / without years) are not parsed HOT 2
- Backcompat parsing conflicts
- Some URL's causes library to "hang"
- href ignored for u-* properties HOT 1
- Alternative node/JS microformats parser
- Dependency "ent" uses deprecated Node punycode module HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microformat-node.