File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -905,7 +905,23 @@ namespace Sass {
905
905
{
906
906
string acc;
907
907
for (size_t i = 0 , L = s->length (); i < L; ++i) {
908
- if ((*s)[i]) acc += interpolation ((*s)[i]);
908
+ // really a very special fix, but this is the logic I got from
909
+ // analyzing the ruby sass behavior and it actually seems to work
910
+ // https://github.com/sass/libsass/issues/1333
911
+ if (i == 0 && L > 1 && dynamic_cast <Function_Call*>((*s)[i])) {
912
+ Expression* ex = (*s)[i]->perform (this );
913
+ if (auto sq = dynamic_cast <String_Quoted*>(ex)) {
914
+ if (sq->is_delayed () && ! s->has_interpolants ()) {
915
+ acc += string_escape (quote (sq->value (), sq->quote_mark ()));
916
+ } else {
917
+ acc += interpolation ((*s)[i]);
918
+ }
919
+ } else if (ex) {
920
+ acc += interpolation ((*s)[i]);
921
+ }
922
+ } else if ((*s)[i]) {
923
+ acc += interpolation ((*s)[i]);
924
+ }
909
925
}
910
926
String_Quoted* str = new (ctx.mem ) String_Quoted (s->pstate (), acc);
911
927
if (!str->quote_mark ()) {
You can’t perform that action at this time.
0 commit comments