@@ -58,6 +58,30 @@ describe('Parse css urls', function(){
5858 urls . should . have . length ( 0 ) ;
5959 } ) ;
6060
61+ it ( 'should handle urls with spaces inside brackets' , function ( ) {
62+ var text1 = '.image { background: url( "1.css"); } ' ;
63+ var urls1 = parseCssUrls ( text1 ) ;
64+ urls1 . should . be . instanceof ( Array ) . and . have . lengthOf ( 1 ) ;
65+ urls1 . should . containEql ( '1.css' ) ;
66+
67+ var text2 = '.image { background: url( "2.css"); } ' ;
68+ var urls2 = parseCssUrls ( text2 ) ;
69+ urls2 . should . be . instanceof ( Array ) . and . have . lengthOf ( 1 ) ;
70+ urls2 . should . containEql ( '2.css' ) ;
71+
72+ var text3 = ".image { background: url('3.css' ); } " ;
73+ var urls3 = parseCssUrls ( text3 ) ;
74+ urls3 . should . be . instanceof ( Array ) . and . have . lengthOf ( 1 ) ;
75+ urls3 . should . containEql ( '3.css' ) ;
76+ } ) ;
77+
78+ it ( 'should handle urls with spaces inside quotes' , function ( ) {
79+ var text = '.image { background: url(" a.css"); } ' ;
80+ var urls = parseCssUrls ( text ) ;
81+ urls . should . be . instanceof ( Array ) . and . have . lengthOf ( 1 ) ;
82+ urls . should . containEql ( ' a.css' ) ;
83+ } ) ;
84+
6185 describe ( 'comments' , function ( ) {
6286 it ( 'should ignore comments and return empty array if there are only comments in text' , function ( ) {
6387 var text = '\
0 commit comments