|
@@ -390,11 +390,20 @@ var policies = {
|
|
return {
|
|
return {
|
|
count: offenders.length,
|
|
count: offenders.length,
|
|
list: offenders.map(function(offender) {
|
|
list: offenders.map(function(offender) {
|
|
|
|
+ if (offender === '[inline CSS] (Empty CSS was provided)') {
|
|
|
|
+ return {
|
|
|
|
+ error: 'Empty style tag',
|
|
|
|
+ file: null,
|
|
|
|
+ line: null,
|
|
|
|
+ column: null
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+
|
|
var parts = /^(?:(?:<([^ \(]*)>|\[inline CSS\]) ?)?(?:\((((?! @ ).)*)(?: @ (\d+):(\d+))?\))?$/.exec(offender);
|
|
var parts = /^(?:(?:<([^ \(]*)>|\[inline CSS\]) ?)?(?:\((((?! @ ).)*)(?: @ (\d+):(\d+))?\))?$/.exec(offender);
|
|
|
|
|
|
if (parts) {
|
|
if (parts) {
|
|
return {
|
|
return {
|
|
- error: parts[2],
|
|
|
|
|
|
+ error: parts[2] || 'Unknown parsing error',
|
|
file: parts[1] || null,
|
|
file: parts[1] || null,
|
|
line: (parts[4] && parts[5]) ? parseInt(parts[4], 10) : null,
|
|
line: (parts[4] && parts[5]) ? parseInt(parts[4], 10) : null,
|
|
column: (parts[4] && parts[5]) ? parseInt(parts[5], 10) : null
|
|
column: (parts[4] && parts[5]) ? parseInt(parts[5], 10) : null
|
|
@@ -406,11 +415,11 @@ var policies = {
|
|
|
|
|
|
if (parts) {
|
|
if (parts) {
|
|
return {
|
|
return {
|
|
- error: parts[1],
|
|
|
|
|
|
+ error: parts[1] || 'Unknown parsing error',
|
|
file: parts[2] || null,
|
|
file: parts[2] || null,
|
|
line: parseInt(parts[3], 10),
|
|
line: parseInt(parts[3], 10),
|
|
column: parseInt(parts[4], 10)
|
|
column: parseInt(parts[4], 10)
|
|
- }
|
|
|
|
|
|
+ };
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|