gobwas / gulp-sprite-generator

Plugin that generate sprites from your stylesheets.
42 stars 16 forks source link

RegExp can't match #15

Open git-lt opened 8 years ago

git-lt commented 8 years ago

source code 61: replacement: new RegExp('background-image:\s+url(\s?(["\']?)\s?' + makeRegexp(url) + '\s?\1\s?)[^;]*\;', 'gi'),

it can be => replacement: new RegExp('background-image:\s?url(\s?(["\']?)\s?' + makeRegexp(url) + '\s?\1\s?)[^;]*\;', 'gi'),

css .level-img.active.level1 {background-image:url(../img/grade_icon_numBjOn.png); }

match /background-image:\s+url(\s?(["']?)\s?..\/img\/grade_icon_numBjOn.png\s?\1\s?)[^;]*\;/.test('background-image:url("../img/grade_icon_numBjOn.png ");') => false

git-lt commented 8 years ago

imageRegex = new RegExp('background-image:[\s]?url(["\']?([\w\d\s!:./-_@].[\w?#]+)["\']?)[^;]\;(?:\s\/_\s@meta\s({.})\s_*\/)?', 'ig');

not match "background:url();"