Skip to content

Commit bc132d9

Browse files
committed
Merge pull request TrySound#21 from MohammadYounes/stringify-unclosed-functions
Should not close unclosed functions
2 parents f31835c + 61f6b09 commit bc132d9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/stringify.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function stringifyNode(node) {
1010
return (node.before || '') + value + (node.after || '');
1111
} else if (Array.isArray(node.nodes)) {
1212
if (type === 'function') {
13-
return value + '(' + (node.before || '') + stringify(node.nodes) + (node.after || '') + ')';
13+
return value + '(' + (node.before || '') + stringify(node.nodes) + (node.after || '') + (node.unclosed ? '' : ')');
1414
} else {
1515
return stringify(node.nodes);
1616
}

test/stringify.js

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ var tests = [
1111
message: 'Should correctly add brackets',
1212
fixture: ' rgba( 12, 54, 65) '
1313
},
14+
{
15+
message: 'Should not close unclosed functions',
16+
fixture: ' rgba( 12, 54, 65 '
17+
},
1418
{
1519
message: 'Should correctly process advanced gradients',
1620
fixture: 'background-image:linear-gradient(45deg,transparent 25%,hsla(0,0%,100%,.2) 25%,hsla(0,0%,100%,.2) 75%,transparent 75%,transparent 25%,hsla(0,0%,100%,.2) 75%,transparent 75%,transparent),linear-gradient(45deg,transparent 25%,hsla(0,0%,100%,.2))'

0 commit comments

Comments
 (0)