Просмотр исходного кода

renamed variables

Former-commit-id: ecffaa87376f5ce59958d363624eeda58e3aa6b2
Gildas 6 лет назад
Родитель
Сommit
8964967532
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      lib/single-file/modules/css-fonts-minifier.js

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

@@ -68,13 +68,13 @@ this.singlefile.lib.modules.fontsMinifier = this.singlefile.lib.modules.fontsMin
 			workStyleElement.remove();
 			docContent += doc.body.innerText;
 			if (getComputedStyle) {
-				fontsInfo.used = fontsInfo.used.map(fontNames => fontNames.map(fontName => {
-					const matchedVar = fontName.match(/^var\((--.*)\)$/);
+				fontsInfo.used = fontsInfo.used.map(fontNames => fontNames.map(familyName => {
+					const matchedVar = familyName.match(/^var\((--.*)\)$/);
 					if (matchedVar && matchedVar[1]) {
-						const computedFontName = getComputedStyle.call(window, options.doc.body).getPropertyValue(matchedVar[1]);
-						return computedFontName || fontName;
+						const computedFamilyName = getComputedStyle.call(window, options.doc.body).getPropertyValue(matchedVar[1]);
+						return computedFamilyName || familyName;
 					}
-					return fontName;
+					return familyName;
 				}));
 			}
 			const variableFound = fontsInfo.used.find(fontNames => fontNames.find(fontName => fontName.startsWith("var(--")));