add functionality for Shippable Build Badges

This commit is contained in:
Mahir Kothary 2015-07-28 13:42:20 -07:00
parent 926fa5c407
commit dafb6ec286

View File

@ -4187,7 +4187,8 @@ function fetchFromSvg(request, url, cb) {
request(url, function(err, res, buffer) {
if (err != null) { return cb(err); }
try {
var match = />([^<>]+)<\/text><\/g>/.exec(buffer);
var badge = buffer.replace(/(?:\r\n\s|\r\s|\n\s)/g, '');
var match = />([^<>]+)<\/text><\/g>/.exec(badge);
cb(null, match[1]);
} catch(e) {
cb(e);