mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
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:
parent
1d4b1753d6
commit
cea3005056
@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user