File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ module.exports = function (css) {
62
62
. replace ( / ^ ' ( .* ) ' $ / , function ( o , $1 ) { return $1 ; } ) ;
63
63
64
64
// already a full url? no change
65
- if ( / ^ ( # | d a t a : | h t t p : \/ \/ | h t t p s : \/ \/ | f i l e : \/ \/ \/ ) / i. test ( unquotedOrigUrl ) ) {
65
+ if ( / ^ ( # | d a t a : | h t t p : \/ \/ | h t t p s : \/ \/ | f i l e : \/ \/ \/ | \s * $ ) / i. test ( unquotedOrigUrl ) ) {
66
66
return fullMatch ;
67
67
}
68
68
Original file line number Diff line number Diff line change @@ -143,6 +143,17 @@ describe("fix urls tests", function() {
143
143
assertUrl ( "body { background-image:url(#bg.jpg); }" ) ;
144
144
} ) ;
145
145
146
+ // empty urls
147
+ it ( "Empty url should be skipped" , function ( ) {
148
+ assertUrl ( "body { background-image:url(); }" ) ;
149
+ assertUrl ( "body { background-image:url( ); }" ) ;
150
+ assertUrl ( "body { background-image:url(\n); }" ) ;
151
+ assertUrl ( "body { background-image:url(''); }" ) ;
152
+ assertUrl ( "body { background-image:url(' '); }" ) ;
153
+ assertUrl ( "body { background-image:url(\"\"); }" ) ;
154
+ assertUrl ( "body { background-image:url(\" \"); }" ) ;
155
+ } ) ;
156
+
146
157
// rooted urls
147
158
it ( "Rooted url" , function ( ) {
148
159
assertUrl (
You can’t perform that action at this time.
0 commit comments