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

Commit 1122ead

Browse files
author
Aaron Leung
committed
Merge pull request #310 from utkarshkukreti/fix-separator-in-append-and-compact
Fix separator in append() and compact()
2 parents 236f1ad + dfb2287 commit 1122ead

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

functions.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ namespace Sass {
854854
l = new (ctx.mem) List(path, position, 1);
855855
*l << ARG("$list", Expression);
856856
}
857-
List* result = new (ctx.mem) List(path, position, l->length() + 1);
857+
List* result = new (ctx.mem) List(path, position, l->length() + 1, l->separator());
858858
string sep_str(unquote(sep->value()));
859859
if (sep_str == "space") result->separator(List::SPACE);
860860
else if (sep_str == "comma") result->separator(List::COMMA);
@@ -898,6 +898,7 @@ namespace Sass {
898898
BUILT_IN(compact)
899899
{
900900
List* arglist = ARG("$values", List);
901+
List::Separator sep = List::COMMA;
901902
if (arglist->length() == 1) {
902903
Expression* the_arg = arglist->value_at_index(0);
903904
arglist = dynamic_cast<List*>(the_arg);
@@ -906,8 +907,9 @@ namespace Sass {
906907
*result << the_arg;
907908
return result;
908909
}
910+
sep = arglist->separator();
909911
}
910-
List* result = new (ctx.mem) List(path, position, 0, List::COMMA);
912+
List* result = new (ctx.mem) List(path, position, 0, sep);
911913
for (size_t i = 0, L = arglist->length(); i < L; ++i) {
912914
Boolean* ith = dynamic_cast<Boolean*>(arglist->value_at_index(i));
913915
if (ith && ith->value() == false) continue;

0 commit comments

Comments
 (0)