else if (isMetaViewport(tag, attrs) && attrName === 'content') {
attrValue = attrValue.replace(/1\.0/g, '1').replace(/\s+/g, '');
}
- else if (options.customAttrCollapse && options.customAttrCollapse.test(attrName)) {
+ else if (attrValue && options.customAttrCollapse && options.customAttrCollapse.test(attrName)) {
attrValue = attrValue.replace(/\n+/g, '');
}
return attrValue;
equal(minify(input, { customAttrCollapse: /ng\-class/ }), output);
});
+ test('custom attribute collapse with empty attribute value', function() {
+ input = '<div ng-some\n\n></div>';
+ output = '<div ng-some></div>';
+
+ equal(minify( input, { customAttrCollapse: /.+/ }), output);
+ });
+
})(typeof exports === 'undefined' ? window : exports);