Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve IE expression parsing #690

Closed
mgreter opened this issue Dec 6, 2014 · 5 comments
Closed

Improve IE expression parsing #690

mgreter opened this issue Dec 6, 2014 · 5 comments

Comments

@mgreter
Copy link
Contributor

mgreter commented Dec 6, 2014

As discussed in #685, we should enhance expression (ie specific) parsing , which currently parses a simple () delimited string. This means it will fail on the following samples (not verified):

left: expression(callSomeFunc());
content: expression("Smile :-)");

@xzyfer proposed a simple parsing function which parses balanced brackets, while beeing aware of quoted strings and other escape sequences. I'm unaware how the original IE parser handles them (it's javascript!), or, what would be more important for us, how the ruby sass implementation is handling this.

@mgreter mgreter changed the title Improve ie expression parsing Improve IE expression parsing Dec 6, 2014
@mgreter
Copy link
Contributor Author

mgreter commented Dec 30, 2014

Maybe the chunk parsing could be used here too, as with the url parser!?

@mgreter
Copy link
Contributor Author

mgreter commented Mar 2, 2015

@xzyfer I guess we can close this minor issue. IMO I have changed the parsing with my latest commit anyway! What do you think? I'd say let's wait if someone screams that it is really broken!

@xzyfer
Copy link
Contributor

xzyfer commented Mar 3, 2015

👍

@al3jo
Copy link

al3jo commented Jun 23, 2015

I have a case in which this is broken. Not completely sure is related with the same issue discussed here, but it has to do with eh IE expression.

Here's the scss:

@mixin spec1() {
  spec1: unquote("3 + \"px\"");
}

@mixin spec2($e) {
  spec2: unquote("#{$e} + \"px\"");
}

@mixin spec3($e) {
  spec3: unquote("#{$e} + 'px'");
}


.element {
  @include spec1;
  @include spec2(3);
  @include spec3(3);
}

The expected result will be:

.element {
  spec1: 3 + "px";
  spec2: 3 + "px";
  spec3: 3 + 'px'; }

However, libsass will output:

.element {
  right: 3 + "px";
  right: 3 + \"px\";
  right: 3 + 'px'; }

I can open a new issue and create specs if you think is needed

@xzyfer
Copy link
Contributor

xzyfer commented Jun 29, 2015

Please open a new issue @al3jo.

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

No branches or pull requests

3 participants