access-sniff
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -164,25 +164,18 @@ 'use strict'; | ||
value: function getElementPosition(htmlString) { | ||
var position = {}; | ||
var htmlArray = this.fileContents.split('\n'); | ||
var position = { | ||
lineNumber: 0, | ||
columnNumber: 0 | ||
}; | ||
htmlArray.every(function (element, lineNumber) { | ||
if (!element.match(htmlString)) { | ||
return true; | ||
} | ||
var indexAt = this.fileContents.indexOf(htmlString); | ||
var before = this.fileContents.slice(0, indexAt); | ||
var stringArray = before.split(/\r\n|\r|\n/); | ||
var columnNumber = 0; | ||
var colIndex = 0; | ||
var pattern = /(\s|\t)/g; | ||
if (indexAt === -1) { | ||
return position; | ||
} | ||
while (element.charAt(colIndex).match(pattern)) { | ||
columnNumber++; | ||
colIndex++; | ||
} | ||
position.lineNumber = stringArray.length; | ||
position.columnNumber = stringArray[position.lineNumber - 1].length; | ||
position.lineNumber = lineNumber; | ||
position.columnNumber = columnNumber; | ||
return false; | ||
}); | ||
return position; | ||
@@ -300,4 +293,7 @@ } | ||
var files = _bluebird2.default.resolve(filesInput); | ||
_logger2.default.startMessage('Starting Accessibility tests'); | ||
if (this.options.verbose) { | ||
_logger2.default.startMessage('Starting Accessibility tests'); | ||
} | ||
return files.bind(this).map(this.fileResolver, { concurrency: 1 }).then(function (messageLog) { | ||
@@ -304,0 +300,0 @@ var logs = {}; |
@@ -37,3 +37,5 @@ 'use strict'; | ||
console.log(heading); | ||
console.log(_chalk2.default.cyan(lineMessage)); | ||
if (message.position.lineNumber || message.position.columnNumber) { | ||
console.log(_chalk2.default.cyan(lineMessage)); | ||
} | ||
console.log(_chalk2.default.grey(message.description)); | ||
@@ -40,0 +42,0 @@ console.log(_chalk2.default.grey('--------------------')); |
{ | ||
"name": "access-sniff", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"description": "A node/iojs library & CLI for HTML_Codesniffer", | ||
@@ -10,2 +10,3 @@ "main": "dist/", | ||
"scripts": { | ||
"start": "gulp", | ||
"test": "gulp test", | ||
@@ -52,2 +53,3 @@ "prepublish": "npm test" | ||
"babel-preset-es2015": "^6.3.13", | ||
"eslint": "^2.2.0", | ||
"gulp": "^3.9.1", | ||
@@ -54,0 +56,0 @@ "gulp-babel": "^6.1.2", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
125934
15
829