|
|
@@ -1316,16 +1316,25 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
content = EMPTY_DATA_URI;
|
|
|
}
|
|
|
}
|
|
|
- declaration.value.children.forEach(token => {
|
|
|
- if (token.type == "Url" && DocUtil.removeQuotes(Util.getCSSValue(token.value)) == originalResourceURL) {
|
|
|
- token.value.value = content;
|
|
|
- }
|
|
|
- });
|
|
|
+ replaceURLs(declaration, originalResourceURL, content);
|
|
|
+ }
|
|
|
+ } else if (resourceURL.startsWith(DATA_URI_PREFIX) && !resourceURL.startsWith(PREFIX_DATA_URI_VND) && !resourceURL.startsWith(PREFIX_DATA_URI_IMAGE_SVG)) {
|
|
|
+ const validResource = await DocUtil.validFont(resourceURL);
|
|
|
+ if (!validResource) {
|
|
|
+ replaceURLs(declaration, originalResourceURL, EMPTY_DATA_URI);
|
|
|
}
|
|
|
}
|
|
|
}));
|
|
|
}
|
|
|
}));
|
|
|
+
|
|
|
+ function replaceURLs(declaration, oldURL, newURL) {
|
|
|
+ declaration.value.children.forEach(token => {
|
|
|
+ if (token.type == "Url" && DocUtil.removeQuotes(Util.getCSSValue(token.value)) == oldURL) {
|
|
|
+ token.value.value = newURL;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|