File tree Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -200,9 +200,28 @@ module.exports = function(css){
200
200
*/
201
201
202
202
function atimport ( ) {
203
- var m = match ( / ^ @ i m p o r t * ( [ ^ ; \n ] + ) ; \s * / ) ;
203
+ return _atruleSimple ( 'import' )
204
+ }
205
+
206
+ /**
207
+ * Parse charset
208
+ */
209
+
210
+ function atcharset ( ) {
211
+ return _atruleSimple ( 'charset' ) ;
212
+ }
213
+
214
+ /**
215
+ * Parse non-block at-rules
216
+ */
217
+
218
+ function _atruleSimple ( ruleName ) {
219
+ var m = match ( new RegExp ( '^@' + ruleName + ' *([^;\\n]+);\\s*' ) ) ;
204
220
if ( ! m ) return ;
205
- return { import : m [ 1 ] . trim ( ) } ;
221
+
222
+ var ret = { }
223
+ ret [ ruleName ] = m [ 1 ] . trim ( ) ;
224
+ return ret ;
206
225
}
207
226
208
227
/**
@@ -233,7 +252,8 @@ module.exports = function(css){
233
252
function atrule ( ) {
234
253
return keyframes ( )
235
254
|| media ( )
236
- || atimport ( ) ;
255
+ || atimport ( )
256
+ || atcharset ( ) ;
237
257
}
238
258
239
259
/**
@@ -248,4 +268,4 @@ module.exports = function(css){
248
268
}
249
269
250
270
return stylesheet ( ) ;
251
- } ;
271
+ } ;
Original file line number Diff line number Diff line change
1
+ @charset "UTF-8" ; /* Set the encoding of the style sheet to Unicode UTF-8*/
2
+ @charset 'iso-8859-15' ; /* Set the encoding of the style sheet to Latin-9 (Western European languages, with euro sign) */
Original file line number Diff line number Diff line change
1
+ {
2
+ "stylesheet" : {
3
+ "rules" : [
4
+ {
5
+ "charset" : " \" UTF-8\" "
6
+ },
7
+ {
8
+ "charset" : " 'iso-8859-15'"
9
+ }
10
+ ]
11
+ }
12
+ }
You can’t perform that action at this time.
0 commit comments