Fix inconsistancy with encoding base64 with data-uri - wasn't calling right function

This commit is contained in:
Luke Page
2015-01-01 17:09:25 +00:00
parent 3f6abd18fe
commit e334d69be4

View File

@@ -68,8 +68,11 @@ module.exports = function(environment) {
}
}
buf = useBase64 ? buf.toString('base64')
: encodeURIComponent(buf);
if (useBase64 && !environment.encodeBase64) {
return fallback(this, filePathNode);
}
buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);
var uri = "data:" + mimetype + ',' + buf + fragment;
return new URL(new Quoted('"' + uri + '"', uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);