-
Notifications
You must be signed in to change notification settings - Fork 464
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
selector interpolation quoted and out of order in 3.3.3 #1947
Comments
I am unable to reproduce the out of order selectors on 3.3.3. However the broken quoting is reproducible. |
The patch to #1907 doesn't appear to fix the quoting issue seen here. This is a different issue. |
This is another instance of .a-#{quote('' + b)} {
c: d;
} |
This PR add specs for sass/libsass#1947
Spec added sass/sass-spec#735 |
Yeah I got the out-of-order selectors with |
@xzyfer I think I've identified what's going on, there's a series of bugs at work: it's not a problem of Re .test {
/* should quote */
out: inspect(quote(b));
/* should not double quote */
out: inspect(quote('' + b));
/* should fail, because input is a list (separate bug) */
out: inspect(quote(a b c));
/* should still not double quote */
out: inspect(quote('a b c'));
} .test {
/* should quote */
out: "b";
/* should not double quote */
out: '"b"';
/* should fail, because input is a list (separate bug) */
out: "a b c";
/* should still not double quote */
out: '"a b c"'; } ...and when trying to interpolate that: /* this is ok */
.foo--#{quote(bar)} { c: d; }
/* this is not ok */
.foo--#{quote('' + bar)} { c: d; }
/* this is just weird */
.foo--#{quote('' + bar)} { @extend %baz; }
%baz { c: d; } /* this is ok */
.foo--bar {
c: d; }
/* this is not ok */
.foo--"bar" {
c: d; }
/* this is just weird */
"bar".foo-- {
c: d; } |
Fix might be quite simple? --- "a/functions-c6921c4-left.cpp"
+++ "b/functions.cpp"
@@ -902,6 +902,10 @@ namespace Sass {
BUILT_IN(sass_quote)
{
AST_Node* arg = env["$string"];
+ if (String_Quoted* qstr = dynamic_cast<String_Quoted*>(arg)) {
+ qstr->quote_mark('*');
+ return qstr;
+ }
std::string str(quote(arg->to_string(ctx.c_options), String_Constant::double_quote()));
String_Quoted* result = SASS_MEMORY_NEW(ctx.mem, String_Quoted, pstate, str);
result->is_delayed(true); Seems to fix the double quote problems and selector interpolations looks better too? /* this is ok */
.foo--bar {
c: d; }
/* this is not ok */
.foo--bar {
c: d; }
/* this is just weird */
.foo--bar {
c: d; } |
@mgreter that sounds like what canonical sass would do, yes: don't quote it if it's already quoted |
Can you check if #1979 fixes this issue? |
Sorry @mgreter I didn't get to testing it but glad to see its closed |
In this gist, you can see expected corrected output; but currently with
node-sass 3.5.0-beta.1
/libsass 3.3.3
I am getting selector interpolation like this for the same code (possible relations: #1633, #1925), which seems to be regression since3.3.2
:The text was updated successfully, but these errors were encountered: