Fix invalid selector exception with empty class values

After removing :before and :after pseudo selectors, a class name may be empty, causing an invalid selector string when joined. Remove empty elements before calling querySelectorAll.
This commit is contained in:
Ben Sholds 2013-11-25 09:48:12 -05:00
parent 1d4b1753d6
commit cea3005056

View File

@ -77,6 +77,9 @@ _html2canvas.Parse = function (images, options, cb) {
for (i = 0, j = classes.length; i < j; i++) {
classes[i] = classes[i].match(/(^[^:]*)/)[1];
}
// remove empty values, if not could cause invalid selectors with querySelectorAll
classes = classes.filter(function (n) { return n });
}
// Using the list of elements we know how pseudo el styles, create fake pseudo elements.
@ -1273,4 +1276,4 @@ _html2canvas.Parse = function (images, options, cb) {
}
}
}
};
};