Skip to content

endlines and comments#2420

Merged
lukeapage merged 3 commits intoless:masterfrom
bassjobsen:patch-10
Jan 30, 2015
Merged

endlines and comments#2420
lukeapage merged 3 commits intoless:masterfrom
bassjobsen:patch-10

Conversation

@bassjobsen
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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