File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 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) {
1616 } else if ( type === "div" ) {
1717 return ( node . before || "" ) + value + ( node . after || "" ) ;
1818 } else if ( Array . isArray ( node . nodes ) ) {
19- buf = stringify ( node . nodes ) ;
19+ buf = stringify ( node . nodes , custom ) ;
2020 if ( type !== "function" ) {
2121 return buf ;
2222 }
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ var tests = [
8989] ;
9090
9191test ( "Stringify" , function ( t ) {
92- t . plan ( tests . length + 3 ) ;
92+ t . plan ( tests . length + 4 ) ;
9393
9494 tests . forEach ( function ( opts ) {
9595 t . equal ( stringify ( parse ( opts . fixture ) ) , opts . fixture , opts . message ) ;
@@ -131,4 +131,13 @@ test("Stringify", function(t) {
131131
132132 tokens [ 1 ] . type = "word" ;
133133 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+ ) ;
134143} ) ;
You can’t perform that action at this time.
0 commit comments