File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,11 @@ module.exports = function(content, map) {
4949		var  importUrlPrefix  =  getImportPrefix ( this ,  query ) ; 
5050
5151		var  alreadyImported  =  { } ; 
52- 		var  importJs  =  result . importItems . filter ( function ( imp )  { 
52+ 		var  importJs  =  result . importItems . map ( function ( imp )  { 
53+ 			// fixes #781 when importing `url(filename.css )` 
54+ 			imp . url  =  imp . url . trim ( ) ; 
55+ 			return  imp ; 
56+ 		} ) . filter ( function ( imp )  { 
5357			if ( ! imp . mediaQuery )  { 
5458				if ( alreadyImported [ imp . url ] ) 
5559					return  false ; 
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ describe("import", function() {
1313	] ,  "" ,  { 
1414		"./test.css" : [ [ 2 ,  ".test{a: b}" ,  "" ] ] 
1515	} ) ; 
16+ 	test ( "import with trailing whitespace" ,  "@import url(test.css );\n.class { a: b c d; }" ,  [ 
17+ 		[ 2 ,  ".test{a: b}" ,  "" ] , 
18+ 		[ 1 ,  ".class { a: b c d; }" ,  "" ] 
19+ 	] ,  "" ,  { 
20+ 		"./test.css" : [ [ 2 ,  ".test{a: b}" ,  "" ] ] 
21+ 	} ) ; 
1622	test ( "import camelcase" ,  "@IMPORT url(test.css);\n.class { a: b c d; }" ,  [ 
1723		[ 2 ,  ".test{a: b}" ,  "" ] , 
1824		[ 1 ,  ".class { a: b c d; }" ,  "" ] 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments