MatthewMueller/cheerio — pull request #331 by jugglinmike (2013-12-18 00:52:49+00:00)
Title: Remove internal `connect` function

[We use the `DomHandler` instance packaged with `htmlparser2`](https://github.com/MatthewMueller/cheerio/blob/a871b6181ffa95664487b3a9ad09b7da6bc79ea6/lib/parse.js#L34) to generate node-like data structures from text input. [The fix to `DomHandler` landed recently](https://github.com/fb55/DomHandler/commit/e7cff0caa8a98ea9a9b5804ddd2c1d4e82a90239) and is [now available at version `3.4.0` of `htmlparser2`](https://github.com/fb55/htmlparser2/commit/7153b2711d6d298396dbd16987c5a34b81f9b999).

I'll admit: the deletion of tests is a bit scary. You can verify that the expectations still hold by updating `htmlparser2` manually (`npm install htmlparser2@3.4.0`) and making the following change:

```diff
describe('.connect', function() {

var create = function(html) {
- var dom = parse.evaluate(html);
- return parse.connect(dom);
+ return parse.evaluate(html);
};
```

...but I don't think it's appropriate for Cheerio to maintain tests for the functionality implemented by one of its dependencies. Equivalent tests have been added to `DomHandler`--see the above commit.

Commit message:

> Most of this function's responsibilities concerned patching incorrect
> behavior of the `htmlparser2` library. Since the parser has been fixed
> in the latest release, that logic (along with the associated unit tests)
> may safely be removed.