diff --git a/extend.cpp b/extend.cpp index 91c8225829..cf70227960 100644 --- a/extend.cpp +++ b/extend.cpp @@ -50,7 +50,15 @@ namespace Sass { Selector_List* ng = 0; while (cplx) { Selector_Placeholder* sp = cplx->find_placeholder(); - if (!sp) break; + if (!sp) { + // After the loop over this rule set's selectors completes, the selectors in + // all_subbed will become the new selectors for this rule set. If we get here, there's no + // placeholder selector in the current complex selector. We don't want to lose + // this selector, so append it to ng, so that it will get added to all_subbed. + ng = new (ctx.mem) Selector_List(sg->path(), sg->position()); + *ng << cplx; + break; + } Compound_Selector* placeholder = new (ctx.mem) Compound_Selector(cplx->path(), cplx->position(), 1); *placeholder << sp; // if the current placeholder can be subbed