1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

Merge pull request #186 from montaggroup/propagate-getUrl-error

propapage the getUrl()-error up through replace.cssUrls()
This commit is contained in:
Fred Chasen 2015-01-13 21:39:08 -05:00
commit af8be27eba

View file

@ -129,9 +129,11 @@ EPUBJS.replace.cssUrls = function(_store, base, text){
matches.forEach(function(str){ matches.forEach(function(str){
var full = EPUBJS.core.resolveUrl(base, str.replace(/url\(|[|\)|\'|\"]/g, '')); var full = EPUBJS.core.resolveUrl(base, str.replace(/url\(|[|\)|\'|\"]/g, ''));
var replaced = _store.getUrl(full).then(function(url){ var replaced = _store.getUrl(full).then(function(url){
text = text.replace(str, 'url("'+url+'")'); text = text.replace(str, 'url("'+url+'")');
}); }, function(reason) {
deferred.reject(reason);
});
promises.push(replaced); promises.push(replaced);
}); });