Skip to content

Commit

Permalink
Fix bug: if the end line is comments, the modifyVars option will have…
Browse files Browse the repository at this point in the history
… no effect.

Closes gh-182.
  • Loading branch information
chenboxiang authored and Tyler Kellen committed May 27, 2014
1 parent 710d72e commit d3c95d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tasks/less.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ module.exports = function(grunt) {
// Properties under options.modifyVars are appended as less variables
// to override global variables.
var modifyVarsOutput = parseVariableOptions(options['modifyVars']);
srcCode += modifyVarsOutput;
if (modifyVarsOutput) {
srcCode += '\n';
srcCode += modifyVarsOutput;
}

parser.parse(srcCode, function(parse_err, tree) {
if (parse_err) {
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/modifyVars.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
padding: @customPadding;
background: url('@{imgPath}/nice-kitty.jpg')
}
// comments

0 comments on commit d3c95d4

Please sign in to comment.