Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 4767390

Browse files
Eric Kimnmgreter
authored andcommitted
Fixing child selector repetition
1 parent 38d356e commit 4767390

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

eval.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,9 +1453,14 @@ namespace Sass {
14531453
if (s->tail()) {
14541454
Selector_List* tails = operator()(s->tail());
14551455
for (size_t m = 0, mL = tails->length(); m < mL; ++m) {
1456-
Complex_Selector* ss = new (ctx.mem) Complex_Selector(*s);
1457-
ss->tail((*tails)[m]);
1458-
*sl << ss;
1456+
Complex_Selector* tailm = (*tails)[m];
1457+
if(head && head->is_superselector_of(tailm)) {
1458+
*sl << s;
1459+
} else {
1460+
Complex_Selector *ss = new(ctx.mem) Complex_Selector(*s);
1461+
ss->tail(tailm);
1462+
*sl << ss;
1463+
}
14591464
}
14601465
}
14611466
else {

0 commit comments

Comments
 (0)