Fix bug in HTML rendering in Node.js
When supplied with a Cheerio instance (instead of a string of HTML), the Node.js-specific `html` and `append` methods should reference the complete outer HTML (not just the contents) as generated by Cheerio's `render` method.
This commit is contained in:
+2
-2
@@ -99,13 +99,13 @@ var $ = require("cheerio");
|
||||
// element to replace the innerHTML with.
|
||||
html: function(root, el) {
|
||||
var $root = root[0] ? root : $(root);
|
||||
$root.html(_.isString(el) ? el : $(el).html());
|
||||
$root.html(_.isString(el) ? el : $.render(el));
|
||||
},
|
||||
|
||||
// Very similar to HTML except this one will appendChild.
|
||||
append: function(root, el) {
|
||||
var $root = root[0] ? root : $(root);
|
||||
$root.append(_.isString(el) ? el : $(el).html());
|
||||
$root.append(_.isString(el) ? el : $.render(el));
|
||||
},
|
||||
|
||||
when: function(promises) {
|
||||
|
||||
Reference in New Issue
Block a user