Removed failing quickfix related to #8

This commit is contained in:
Ben Zörb 2015-04-29 06:23:39 +02:00
parent ec604aa377
commit be7a25e391

View File

@ -102,22 +102,7 @@ module.exports = function(html, styles, options) {
var dom = parse($.html());
var markup = render(cleanupDom(dom));
var markup = render(dom);
return new Buffer(markup);
};
// prevent closing tags in svg caused by a single newline element added by htmlparser
function cleanupDom(dom,svg) {
if (svg && _.size(dom.children) === 1) {
dom.children = _.reject( dom.children, function(child) {
return !child.name && (child.data || '').replace(/[\s\r\n]+/,'') === '';
});
} else {
dom.children = _.map(dom.children, function(child){
return cleanupDom(child, svg || child.name === 'svg');
});
}
return dom;
}