Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

endlines and comments #2420

Merged
merged 3 commits into from
Jan 30, 2015
Merged

endlines and comments #2420

merged 3 commits into from
Jan 30, 2015

Conversation

bassjobsen
Copy link
Contributor

possible fix for #2370

I have used the following command to test this issue: printf "p {\r//less\rc:1;\r}\r" | lessc -

I'm not sure if this the most efficient fix.
I also tried var nextNewLine = inp.substr(parserInput.i + 1).search(/\n|\r/); to replace the indexOf but then i expect possible mismatches for \r\n which match on the first \r.

possible fix for less#2370

I have used the following command to test this issue: `printf "p {\r//less\rc:1;\r}\r" | lessc -`

I'm not sure if this the most efficient fix.
I also tried `var nextNewLine = inp.substr(parserInput.i + 1).search(/\n|\r/);` to replace the `indexOf` but then i expect possible mismatches for `\r\n` which match on the first `\r`.
@lukeapage
Copy link
Member

Make your change here instead
https://github.com/less/less.js/blob/master/lib/less/parser/parser.js#L105
And just add a ? After \n e.g. \r\n?

@bassjobsen
Copy link
Contributor Author

indeed only one question mark fix this issue. Nice. Thank you!

lukeapage added a commit that referenced this pull request Jan 30, 2015
@lukeapage lukeapage merged commit 163a8c4 into less:master Jan 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants