Skip to content

Commit 1ebfe75

Browse files
committed
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 :)
1 parent a711269 commit 1ebfe75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/CSSLint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ var CSSLint = (function(){
125125
parser = new parserlib.css.Parser({ starHack: true, ieFilters: true,
126126
underscoreHack: true, strict: false });
127127

128-
lines = text.split(/\n\r?/g);
128+
lines = text.replace(/\n\r?/g, "$split$").split('$split$');
129129

130130
if (!ruleset){
131131
ruleset = {};

0 commit comments

Comments
 (0)