From 1ebfe75084732663ae5890940e3959e79c474ce8 Mon Sep 17 00:00:00 2001 From: Daniel Lamb Date: Tue, 24 Jan 2012 16:14:08 -0800 Subject: [PATCH] This is seems to be a bug with the regex use of split, blank lines are not included so the line number used for evidence don't match up. Using a regex to do the split skips all blank lines: lines = text.split(/\n\r?/g); //current code This can be fixed if you instead use the regex to replace line feeds with a unique value and then a simple string to split on (not a regex). lines = text.replace(/\n\r?/g, "$split$").split('$split$'); //fix that worked for me :) --- src/core/CSSLint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/CSSLint.js b/src/core/CSSLint.js index a78f44e2..a8ce65bd 100644 --- a/src/core/CSSLint.js +++ b/src/core/CSSLint.js @@ -125,7 +125,7 @@ var CSSLint = (function(){ parser = new parserlib.css.Parser({ starHack: true, ieFilters: true, underscoreHack: true, strict: false }); - lines = text.split(/\n\r?/g); + lines = text.replace(/\n\r?/g, "$split$").split('$split$'); if (!ruleset){ ruleset = {};