Skip to content

Commit 370eb25

Browse files
committed
add @import messed up whitespace test
1 parent aa56c0c commit 370eb25

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ module.exports = function(css){
185185
function atimport() {
186186
var m = match(/^@import *([^;\n]+);\s*/);
187187
if (!m) return;
188-
return { import: m[1] };
188+
return { import: m[1].trim() };
189189
}
190190

191191
/**

test/cases/import.messed.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
@import url("fineprint.css") print;
3+
@import url("bluish.css") projection, tv;
4+
@import 'custom.css';
5+
@import "common.css" screen, projection ;
6+
7+
@import url('landscape.css') screen and (orientation:landscape);

test/cases/import.messed.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"stylesheet": {
3+
"rules": [
4+
{
5+
"import": "url(\"fineprint.css\") print"
6+
},
7+
{
8+
"import": "url(\"bluish.css\") projection, tv"
9+
},
10+
{
11+
"import": "'custom.css'"
12+
},
13+
{
14+
"import": "\"common.css\" screen, projection"
15+
},
16+
{
17+
"import": "url('landscape.css') screen and (orientation:landscape)"
18+
}
19+
]
20+
}
21+
}

0 commit comments

Comments
 (0)