handle mixed type children correctly - fixes #443

This commit is contained in:
webcss 2015-02-07 00:18:07 +01:00
parent 4b92c821c2
commit 96b1f9e791

View file

@ -51,12 +51,12 @@ var m = (function app(window, undefined) {
if (classes.length > 0) cell.attrs[classAttrName] = classes.join(" ");
var children = hasAttrs ? args[2] : args[1];
if (type.call(children) === ARRAY) {
cell.children = children
var children = hasAttrs ? args.slice(2) : args.slice(1);
if (children.length === 1 && type.call(children[0]) === ARRAY) {
cell.children = children[0]
}
else {
cell.children = hasAttrs ? args.slice(2) : args.slice(1)
cell.children = children
}
for (var attrName in attrs) {