소스 검색

fixed issue with empty URLs

Former-commit-id: d10acb4f30d5e867c3449f6f5c2494b7723380fa
Gildas 6 년 전
부모
커밋
c9acc1252c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lib/single-file/single-file-core.js

+ 1 - 1
lib/single-file/single-file-core.js

@@ -1417,7 +1417,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 							// ignored
 						}
 						if (Util.testValidURL(resolvedURL) && resourceURL != resolvedURL && stylesheetContent.includes(urlFunction)) {
-							stylesheetContent = stylesheetContent.replace(Util.getRegExp(urlFunction), urlFunction.replace(originalResourceURL, resolvedURL));
+							stylesheetContent = stylesheetContent.replace(Util.getRegExp(urlFunction), originalResourceURL ? urlFunction.replace(originalResourceURL, resolvedURL) : "url(" + resolvedURL + ")");
 						}
 					} else {
 						let newUrlFunction;