Przeglądaj źródła

parse the declaration value only

Gildas 7 lat temu
rodzic
commit
df291d154c
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      lib/single-file/modules/css-fonts-minifier.js

+ 2 - 2
lib/single-file/modules/css-fonts-minifier.js

@@ -186,9 +186,9 @@ this.fontsMinifier = this.fontsMinifier || (() => {
 			}
 		}
 		const font = declarations.children.filter(node => node.property == "font").tail;
-		if (font) {
+		if (font && font.data && font.data.value) {
 			try {
-				const parsedFont = fontPropertyParser.parse(cssTree.generate(font.data));
+				const parsedFont = fontPropertyParser.parse(cssTree.generate(font.data.value));
 				parsedFont.family.forEach(familyName => fontFamilyNames.push(getFontFamily(familyName)));
 			} catch (error) {
 				// ignored