Skip to content

Commit ebd6615

Browse files
committed
change regexp for base64 encoded sources
1 parent 69fc17c commit ebd6615

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/load.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ var Loader = function (data) {
258258
url = urlMatch[2];
259259
logger.log(urlMatch[0]);
260260

261-
if (url && !utils.isEmbeddedImage(url)) {
261+
if (url && !utils.isEmbeddedSource(url)) {
262262
var urlAbsolutePath = utils.getAbsolutePath(cssRemotePath, url);
263263
var result = loadFileFromUrl(urlAbsolutePath, cssLocalDirname);
264264

lib/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ function pathToUnixFormat(filepath) {
4646
}
4747

4848
// Check if path contains base64 encoded image
49-
function isEmbeddedImage(path) {
50-
var embeddedImageRegexp = /data:image\//;
49+
function isEmbeddedSource(path) {
50+
var embeddedImageRegexp = /data:(.*?);base64,/;
5151
return embeddedImageRegexp.test(path);
5252
}
5353

5454
module.exports.getAbsolutePath = getAbsolutePath;
5555
module.exports.pathToUnixFormat = pathToUnixFormat;
56-
module.exports.isEmbeddedImage = isEmbeddedImage;
56+
module.exports.isEmbeddedSource = isEmbeddedSource;
5757
module.exports.trimUrl = trimUrl;
5858
module.exports.trimFilename = trimFilename;

0 commit comments

Comments
 (0)