Created
November 19, 2015 08:37
-
-
Save xianhuazhou/b32c0d10bcb22335a96d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('div.rule-violations').each(function() { | |
var header = $(this).find('h2').text().replace(/\s+/g, " "); | |
var labels = $(this).find('ul li.label').map(function() { | |
return $(this).text(); | |
}).get().join(', '); | |
console.log(header + " (" + labels + ")"); | |
var titles = []; | |
$(this).find('div.violations div.location').each(function() { | |
titles.push(" " + $(this).html().replace(/\s+/g, " ")); | |
}); | |
if (titles.length > 0) { | |
console.log(titles.join("\n")); | |
} else { | |
console.log(' ' + $(this).find('div.violation-context').text().replace(/\s+/g, " ")); | |
} | |
console.log("\n\n"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment