|
|
@@ -1229,7 +1229,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
|
|
|
async function processFontFaceRule(cssRule) {
|
|
|
await Promise.all(cssRule.block.children.toArray().map(async declaration => {
|
|
|
- if (declaration.type == "Declaration") {
|
|
|
+ if (declaration.type == "Declaration" && declaration.value.children) {
|
|
|
const urlFunctions = DomUtil.getUrlFunctions(DomUtil.getCSSValue(declaration.value));
|
|
|
await Promise.all(urlFunctions.map(async urlFunction => {
|
|
|
const originalResourceURL = DomUtil.matchURL(urlFunction);
|
|
|
@@ -1244,15 +1244,11 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
if (!validResource) {
|
|
|
content = EMPTY_DATA_URI;
|
|
|
}
|
|
|
- if (declaration.value.children) {
|
|
|
- declaration.value.children.forEach(token => {
|
|
|
- if (token.type == "Url" && DOM.removeQuotes(DomUtil.getCSSValue(token.value)) == originalResourceURL) {
|
|
|
- token.value.value = content;
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- declaration.value = "url(" + content + ")";
|
|
|
- }
|
|
|
+ declaration.value.children.forEach(token => {
|
|
|
+ if (token.type == "Url" && DOM.removeQuotes(DomUtil.getCSSValue(token.value)) == originalResourceURL) {
|
|
|
+ token.value.value = content;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}));
|