joscha / gulp-rewrite-css

A gulp plugin that allows rewriting url references in CSS
MIT License
17 stars 12 forks source link

Regex for URLs does not handle comma after url() #57

Closed frankszymanski closed 7 years ago

frankszymanski commented 7 years ago

The spec for the cursor CSS property (https://developer.mozilla.org/en-US/docs/Web/CSS/cursor) has examples where a url is followed by a comma. For example:

.baz {
  cursor: url(hyper.cur), auto;
}

The regex appears to need to be updated to include a comma in the final grouping: url\s*\(\s*(?!["']?data:)(.+?)\)(?=\s+(?!\))|;|}) to url\s*\(\s*(?!["']?data:)(.+?)\)(?=\s+(?!\))|;|}|,)

joscha commented 7 years ago

Sounds good, could you create a PR with a test, please?

frankszymanski commented 7 years ago

PR Opened.

joscha commented 7 years ago

closed via 79da79d