Skip to content

Commit 04be572

Browse files
committed
Merge pull request #9 from csscomb/ss
Trim more spaces (#5)
2 parents a6bc513 + de76842 commit 04be572

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

lib/rules/strip-spaces.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ module.exports = {
88
* @param {node} node
99
*/
1010
process: function(nodeType, node) {
11+
if (nodeType === 's') {
12+
node[0] = node[0].replace(/[ \t]+\n/g, '\n');
13+
}
14+
1115
if (nodeType === 'stylesheet') {
1216
if (node[node.length - 1][0] === 's') node.pop();
1317
node.push(['s', '\n']);

test/test.css

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ div{
88
top:0;
99
}
1010
div p em{
11-
font-style:italic;
12-
border-bottom:1px solid red;
13-
}
14-
11+
font-style:italic;
12+
border-bottom:1px solid red;
13+
}
14+
1515
/* Фигурные скобки. Вариант 2 */
1616
div
1717
{
1818
padding:0;
1919
margin:0;
2020
}
21-
div p
21+
div p
2222
{
2323
font-size:1px;
24-
top:0;
24+
top:0;
2525
}
2626
div p em
2727
{
28-
font-style:italic;/* inline comment*/
28+
font-style:italic;/* inline comment*/
2929
border-bottom:1px solid red;
3030
}
3131

32-
/* Фигурные скобки. Вариант 3 */
32+
/* Фигурные скобки. Вариант 3 */
3333
div {
3434
padding:0;
3535
margin:0;

0 commit comments

Comments
 (0)