Skip to content

Commit

Permalink
Merge pull request sass#1137 from xzyfer/fix/compact-comment-output
Browse files Browse the repository at this point in the history
Fix comment_to_string edge case
  • Loading branch information
xzyfer committed Apr 26, 2015
2 parents 73979ff + af40c98 commit f3dd7e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ namespace Sass {
{
string str = "";
size_t has = 0;
char prev = 0;
bool clean = false;
for (auto i : text) {
if (clean) {
Expand All @@ -188,7 +189,8 @@ namespace Sass {
else {
clean = false;
str += ' ';
str += i;
if (prev == '*' && i == '/') str += "*/";
else str += i;
}
} else if (i == '\n') {
clean = true;
Expand All @@ -197,6 +199,7 @@ namespace Sass {
} else {
str += i;
}
prev = i;
}
if (has) return str;
else return text;
Expand Down

0 comments on commit f3dd7e1

Please sign in to comment.