Skip to content

Commit

Permalink
Merge pull request #3 from pavelpower/2_fixed-regexp-for-url-data-image
Browse files Browse the repository at this point in the history
[#2] fixed regexp for url data image
  • Loading branch information
pavelpower committed May 29, 2015
2 parents 2ce8a27 + 269784a commit dc5731b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions techs/css-less.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ module.exports = require('enb/techs/css').buildFlow()
if (relativeUrl) {
var urls = body.match(urlRegexp);
if (urls !== undefined) {
body = body.replace(/url\(['"]{0,1}([^'"\)]*)['"]{0,1}\)/gm, 'url("' +
require('path').dirname(path) +
'/$1")');
body = body.replace(/url\((?!data:image)['"]{0,1}([^'"\)]*)['"]{0,1}\)/gm,
[ 'url("',
require('path').dirname(path),
'/$1")'
].join(''));
}
}

Expand Down

0 comments on commit dc5731b

Please sign in to comment.