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

Fix bug: if the end line is comments, the modifyVars option will have no effect #182

Closed
wants to merge 1 commit into from

Conversation

chenboxiang
Copy link
Contributor

If the end line is comments, the modifyVars option will have no effect.

@tkellen
Copy link
Member

tkellen commented May 25, 2014

Thanks for the PR @chenboxiang! Is this bug present upstream in less itself? If so, it should be fixed there, not here.

@chenboxiang
Copy link
Contributor Author

@tkellen OK, I will try it later.

@chenboxiang
Copy link
Contributor Author

@tkellen This problem is not the less parser's bug.
Here is an example: the test.less file source code:

@height: 20px;
.cls {
    height: @height;
}
// comments

now execute the command:

bin/lessc test.less --modify-var="height=30px"

the expected result is the @height will transform to 30px, but it is still 20px.

The reason is the variables append to the less source tail without LF. The transformed source:

@height: 20px;
.cls {
    height: @height;
}
// comments@height:30px;

So the variables will be resolved to comments.

The same problem is also in lessc command. And I pull a request to less too, it is here.

@tkellen
Copy link
Member

tkellen commented May 27, 2014

Great catch! I'd be happy to merge and publish this, but before I can I need you to sign our CLA:
http://dojofoundation.org/about/claForm

@chenboxiang
Copy link
Contributor Author

@tkellen Thank you very much! I signed the CLA yet.

@tkellen tkellen closed this in d3c95d4 May 27, 2014
@tkellen
Copy link
Member

tkellen commented May 27, 2014

Published as 0.11.1!

@chenboxiang
Copy link
Contributor Author

Great!

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