GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
This regex. should probably allow for whitespace between parenthesis and quotes or CssRewriteFilter will destroy the urls.
Allow whitespace in url()
are they allowed in CSS ?
Afaik whitespaces are never allowed (unencoded) in URIs at all, are they? 😕
Update: Is it just update whitespace before and after the actual URL, but not within? The new regex looks like that.
url( "http://example.com/foo.css" );
Yes, exactly like the example. Not whitespace in the URL but outside of the quotes inside the parenthesis. Only \s* is added, the regex is otherwise unchanged.
Since the quotes are optional it could also be:
url( http://example.com/foo.css );
Please add a test covering this case
Added more expected results in test of CssUtils::filterUrls to check …
…for correct handling of URLs surrounded by quotes and whitespace.
Tests added for URLs surrounded by different combinations of quotes and/or whitespace.
You should probably add tab & new line, too. They are allowed:
New lines are supported, too. They currently don't match with the regex, or do they?
@apfelbox tabs are covered by \s
@stof yep, but they currently aren't covered in the tests (that's where the comment was placed).
Added expected result in test of CssUtils::filterUrls to check for co…
…rrect handling of URLs surrounded by whitespace containing tabs and newlines.
Added URLs surrounded by whitespace in CssRewriteFilterTest
shouldn't the same be done for imports ?