-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PR #726 adding 'appendTo()' and 'prependTo()'
Some improvements was asked by @jugglinmike for the pull request #726 which was intended to fix issue #641 by adding the two functions 'appendTo()' and 'prependTo()'. This commit is a continuation of #726 and fixes it. This is a combination of 5 commits: - Fix incorrect indentation - Fix the two test description provided - Extend arguments for '.appendTo()' and '.prependTo()' Based on jQuery documentation, these two functions accept also Node and Array as argument. As 'a.appendTo(b)' is actually just 'b.append(a)', the function has to convert the target to a Cheerio object as long as it is not one already. - Add unit tests to '.appendTo()' and '.prependTo()' These test case are intended to verify the correct behavior of functions for different arguments accepted according to the jQuery documentation (htmlString, Cheerio object, Node element, selector or Array of elements). - Update API documentation with '.appendTo()' and '.prependTo()' Moreover, there is two more changes which are not directly related: - Fix one incorrect unit test of '.after()' with Node object - Rename argument 'content' to 'target' in 'insert[After|Before]()' API
- Loading branch information
Showing
3 changed files
with
84 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters