|
|
@@ -274,7 +274,9 @@ this.fontsMinifier = this.fontsMinifier || (() => {
|
|
|
removedNodes.pop();
|
|
|
removedNodes.forEach(node => cssRule.block.children.remove(node));
|
|
|
const srcDeclaration = cssRule.block.children.filter(node => node.property == "src").tail;
|
|
|
- srcDeclaration.data.value = cssTree.parse(fontInfo.map(fontSource => fontSource.src).join(","), { context: "value" });
|
|
|
+ if (srcDeclaration) {
|
|
|
+ srcDeclaration.data.value = cssTree.parse(fontInfo.map(fontSource => fontSource.src).join(","), { context: "value" });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function filterUnusedFonts(rules, declaredFonts, unusedFonts, filteredUsedFonts, docContent) {
|
|
|
@@ -435,7 +437,7 @@ this.fontsMinifier = this.fontsMinifier || (() => {
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
- function getFontFamily(string) {
|
|
|
+ function getFontFamily(string = "") {
|
|
|
string = string.toLowerCase().trim();
|
|
|
if (string.match(REGEXP_SIMPLE_QUOTES_STRING)) {
|
|
|
string = string.replace(REGEXP_SIMPLE_QUOTES_STRING, "$1");
|