Skip to content

Conversation

@daniellmb
Copy link
Contributor

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 :)

…e 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 :)
nzakas added a commit that referenced this pull request Jan 31, 2012
'Evidence' is wrong when running under WSH
@nzakas nzakas merged commit 85fef33 into CSSLint:master Jan 31, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants