MatthewMueller/cheerio — pull request #140 by jugglinmike (2012-12-20 03:02:02+00:00)
Title: Introduce "$.contains"

I implemented this method for another project and thought it might be useful upstream. This is a bit more than a simple patch as I added a new test file and test fixture (that fixture could also make the `.find()` tests more thorough). I tried to follow the style of the rest of the project, but I'm open to any minor things to make this jive better :)

(commit message follows)

From [the jQuery API docs on $.contain()](http://api.jquery.com/jQuery.contains/)

> Description: Check to see if a DOM element is within another DOM element.
>
> jQuery.contains( container, contained )
>
> - **container** The DOM element that may contain the other element.
> - **contained** The DOM element that may be contained by the other element.
>
> **Note:** The first argument *must* be a DOM element, not a jQuery object or
> plain JavaScript object.

Add additional fixture to more thoroughly test the logic for nested structures.

Add to project documentation.