Skip to content

Commit 13adf2c

Browse files
committed
Fix parent selector interpolation in attribute selector
Fixes #1016
1 parent 348fde8 commit 13adf2c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

contextualize.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,19 @@ namespace Sass {
3232
Selector_List* ss = 0;
3333
if (p) {
3434
ss = new (ctx.mem) Selector_List(s->pstate(), p->length() * s->length());
35+
if (s->length() == 0) {
36+
Complex_Selector* comb = static_cast<Complex_Selector*>(parent->perform(this));
37+
if (parent->has_line_feed()) comb->has_line_feed(true);
38+
if (comb) *ss << comb;
39+
else cerr << "Warning: contextualize returned null" << endl;
40+
}
3541
for (size_t i = 0, L = p->length(); i < L; ++i) {
3642
for (size_t j = 0, L = s->length(); j < L; ++j) {
3743
parent = (*p)[i];
3844
Complex_Selector* comb = static_cast<Complex_Selector*>((*s)[j]->perform(this));
3945
if (parent->has_line_feed()) comb->has_line_feed(true);
4046
if (comb) *ss << comb;
47+
else cerr << "Warning: contextualize returned null" << endl;
4148
}
4249
}
4350
}

contextualize_eval.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ namespace Sass {
6464
// the value might be interpolated; evaluate it
6565
String* v = s->value();
6666
if (v && eval) {
67-
Eval* eval_with = eval->with(env, backtrace);
67+
Eval* eval_with = eval->with(parent, env, backtrace);
6868
v = static_cast<String*>(v->perform(eval_with));
6969
}
7070
To_String toString;

0 commit comments

Comments
 (0)