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

Syntax Error for url(//...) #2238

Closed
donaldpipowitch opened this issue Oct 21, 2014 · 4 comments
Closed

Syntax Error for url(//...) #2238

donaldpipowitch opened this issue Oct 21, 2014 · 4 comments

Comments

@donaldpipowitch
Copy link

The following code throws an error with 2.0.0-b1:

@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 200;
  src: local('Source Sans Pro ExtraLight'), local('SourceSansPro-ExtraLight'), url(//themes.googleusercontent.com/static/fonts/sourcesanspro/v5/toadOcfmlt9b38dHJxOBGLhZfOo4eSOlrve6pGrXHAo.woff) format('woff');
}

@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 300;
  src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url(//themes.googleusercontent.com/static/fonts/sourcesanspro/v5/toadOcfmlt9b38dHJxOBGIPZSf8Ud0kNoe3bGnF7K24.woff) format('woff');
}
SyntaxError: expected ')' got ''' in .../test.less on line 9, column 16:
8 @font-face {
9   font-family: 'Source Sans Pro';
10   font-style: normal;

Works in older Less versions.

@seven-phases-max
Copy link
Member

Confirmed, the minimal example is:

x {
    y: url(//z);
}

It seems that now it interpreters // there as a comment.
(I guess this is because autoCommentAbsorb no longer has any effect at this point, no idea of how to fix it though).

@seven-phases-max seven-phases-max changed the title Syntax Error after second @font-face Syntax Error for url(//...) Oct 21, 2014
@lukeapage
Copy link
Member

we need to set autoAbsorb comment before calling the regex that will absorb url(
then undo it if it comes back with no match

@lukeapage
Copy link
Member

I'll have a go at this now if you aren't doing it...

@seven-phases-max
Copy link
Member

@lukeapage, yes, please :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants