joscha / gulp-rewrite-css

A gulp plugin that allows rewriting url references in CSS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regex for URLs does not handle comma after url()

frankszymanski opened this issue · comments

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+(?!\))|;|}|,)

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

PR Opened.

closed via 79da79d