SomMeri / less4j

Less language is an extension of css and less4j compiles it into regular css. Less adds several dynamic features into css: variables, expressions, nested rules, and so on. Less was designed to be compatible with css and any correct css file is also correct less file.
145 stars 47 forks source link

Compilation error when a unicode non-breaking space is in less file. #274

Closed FrankWalinga closed 9 years ago

FrankWalinga commented 9 years ago

My less file won't compile when there's a unicode non-breaking space (U+00A0) somewhere.

Example: This won't work (the nbsp is between the semicolon and the hashtag): @MyColour: #ff6933; But this will: @MyColour: #ff6933;

This doesn't occur when you reference a different variable, like: @MyColour: @OtherColour;

gdelhumeau commented 9 years ago

Hi. I have hit a similar issue:

.myClass { // with a non-breaking space just before "{"
  .myOtherClass {
    color: red;
  }
}

It compiles to:

.myClass  .myOtherClass {
  color: red;
}

which is not interpreted by both Chrome and Firefox.

With less.js, it compiles to:

.myClass .myOtherClass {
  color: red;
}

which works.

I believe using a non-breaking space was not intended in the first place, but because it worked with less.js, we haven't noticed it. I have fixed it in my project by putting a regular space instead. But I think it is still important to report it since it is a difference between less4j and less.js

SomMeri commented 9 years ago

This comment fails too: //nbsp:| |

SomMeri commented 9 years ago

Fixed, it will be available in the next release. If it still does not work as expected after that, let me know. New release should be available by the end of this week, if you need it faster leave the comment.

gdelhumeau commented 9 years ago

Thanks @SomMeri. No need for a quick release from my side.

FrankWalinga commented 9 years ago

Thanks guys! I won't be needing a quick release either.