File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ function stringifyNode(node, custom) {
16
16
} else if ( type === "div" ) {
17
17
return ( node . before || "" ) + value + ( node . after || "" ) ;
18
18
} else if ( Array . isArray ( node . nodes ) ) {
19
- buf = stringify ( node . nodes ) ;
19
+ buf = stringify ( node . nodes , custom ) ;
20
20
if ( type !== "function" ) {
21
21
return buf ;
22
22
}
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ var tests = [
89
89
] ;
90
90
91
91
test ( "Stringify" , function ( t ) {
92
- t . plan ( tests . length + 3 ) ;
92
+ t . plan ( tests . length + 4 ) ;
93
93
94
94
tests . forEach ( function ( opts ) {
95
95
t . equal ( stringify ( parse ( opts . fixture ) ) , opts . fixture , opts . message ) ;
@@ -131,4 +131,13 @@ test("Stringify", function(t) {
131
131
132
132
tokens [ 1 ] . type = "word" ;
133
133
t . equal ( stringify ( tokens ) , " rgba " , "Shouldn't process nodes of work type" ) ;
134
+
135
+ t . equal (
136
+ stringify ( parse ( "calc(1px + var(--bar))" ) , function ( node ) {
137
+ if ( node . type === "function" && node . value === "var" ) {
138
+ return "10px" ;
139
+ }
140
+ } ) ,
141
+ "calc(1px + 10px)"
142
+ ) ;
134
143
} ) ;
You can’t perform that action at this time.
0 commit comments