File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,15 @@ namespace Sass {
37
37
bool scheduled_delimiter;
38
38
39
39
public:
40
+ // output strings different in comments
40
41
bool in_comment;
42
+ // selector list does not get linefeeds
41
43
bool in_wrapped;
44
+ // lists always get a space after delimiter
42
45
bool in_media_block;
46
+ // nested list must not have parentheses
43
47
bool in_declaration;
48
+ // nested lists need parentheses
44
49
bool in_space_array;
45
50
bool in_comma_array;
46
51
Original file line number Diff line number Diff line change 1
- #include " inspect.hpp"
2
- #include " ast.hpp"
3
- #include " context.hpp"
4
- #include " utf8/checked.h"
5
1
#include < cmath>
6
2
#include < string>
7
3
#include < iostream>
8
4
#include < iomanip>
9
5
#include < stdint.h>
10
6
#include < stdint.h>
11
7
8
+ #include " ast.hpp"
9
+ #include " inspect.hpp"
10
+ #include " context.hpp"
11
+ #include " utf8/checked.h"
12
+
12
13
namespace Sass {
13
14
using namespace std ;
14
15
@@ -99,9 +100,10 @@ namespace Sass {
99
100
append_token (at_rule->keyword (), at_rule);
100
101
if (at_rule->selector ()) {
101
102
append_mandatory_space ();
103
+ bool was_wrapped = in_wrapped;
102
104
in_wrapped = true ;
103
105
at_rule->selector ()->perform (this );
104
- in_wrapped = false ;
106
+ in_wrapped = was_wrapped ;
105
107
}
106
108
if (at_rule->block ()) {
107
109
at_rule->block ()->perform (this );
Original file line number Diff line number Diff line change @@ -349,19 +349,21 @@ namespace Sass {
349
349
350
350
append_scope_opener ();
351
351
352
+ bool format = kwd != " @font-face" ;;
353
+
352
354
for (size_t i = 0 , L = b->length (); i < L; ++i) {
353
355
Statement* stm = (*b)[i];
354
356
if (!stm->is_hoistable ()) {
355
357
stm->perform (this );
356
- if (i < L - 1 ) append_special_linefeed ();
358
+ if (i < L - 1 && format ) append_special_linefeed ();
357
359
}
358
360
}
359
361
360
362
for (size_t i = 0 , L = b->length (); i < L; ++i) {
361
363
Statement* stm = (*b)[i];
362
364
if (stm->is_hoistable ()) {
363
365
stm->perform (this );
364
- if (i < L - 1 ) append_special_linefeed ();
366
+ if (i < L - 1 && format ) append_special_linefeed ();
365
367
}
366
368
}
367
369
You can’t perform that action at this time.
0 commit comments