Skip to content

Commit af40c98

Browse files
committed
Fix comment_to_string edge case
1 parent 73979ff commit af40c98

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

util.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ namespace Sass {
177177
{
178178
string str = "";
179179
size_t has = 0;
180+
char prev = 0;
180181
bool clean = false;
181182
for (auto i : text) {
182183
if (clean) {
@@ -188,7 +189,8 @@ namespace Sass {
188189
else {
189190
clean = false;
190191
str += ' ';
191-
str += i;
192+
if (prev == '*' && i == '/') str += "*/";
193+
else str += i;
192194
}
193195
} else if (i == '\n') {
194196
clean = true;
@@ -197,6 +199,7 @@ namespace Sass {
197199
} else {
198200
str += i;
199201
}
202+
prev = i;
200203
}
201204
if (has) return str;
202205
else return text;

0 commit comments

Comments
 (0)