Skip to content

Commit

Permalink
fix color
Browse files Browse the repository at this point in the history
  • Loading branch information
yaniswang committed Oct 8, 2015
1 parent 33841cd commit 1c5c07f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/htmlhint
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function hintAllFiles(arrTargets, options){
arrJson.push({'file': filepath, 'messages': messages});
}
else{
console.log(' '+path.relative(process.cwd(), filepath));
console.log(' '+path.relative(process.cwd(), filepath).white);
messages.forEach(function(hint){
var leftWindow = 40;
var rightWindow = leftWindow + 20;
Expand All @@ -116,15 +116,15 @@ function hintAllFiles(arrTargets, options){
evidence += '...';
}
// show evidence
console.log(' L%d |%s', line, evidence.gray);
console.log(' L%d |%s'.white, line, evidence.gray);
// show pointer & message
var pointCol = col - leftCol;
// add double byte character
var match = evidence.substring(0, pointCol).match(/[^\u0000-\u00ff]/g);
if(match !== null){
pointCol += match.length;
}
console.log(' %s^ %s', repeatStr(String(line).length + 3 + pointCol), (hint.message + ' (' + hint.rule.id+')')[hint.type === 'error'?'red':'yellow']);
console.log(' %s^ %s'.white, repeatStr(String(line).length + 3 + pointCol), (hint.message + ' (' + hint.rule.id+')')[hint.type === 'error'?'red':'yellow']);
});
console.log('');
}
Expand Down

0 comments on commit 1c5c07f

Please sign in to comment.