imsky/cssFx

@import regexp error

edriang opened this issue · 2 comments

This is the RegExp used when finding @import statements:

/@import\s+(?:url(['"]?(.)['"]?))\s;?/gim;

The problem is that the resulting url sometimes include "double quotes", so then the browser outputs a 404 error.

It works anyway, but the error is uggly.

You can change, for example, the "(.)" part for something like ([^\")]

Thanks

I don't know why, but the post remove some parts of the regexp. I'm talking about line #155, and the solutions is to use a diferent selector than (.)* because it also select last quotes. Thanks again

Will take a look into this.