v1.5.04 - fix redundand : for loaded fonts

This commit is contained in:
Azgaar 2021-02-01 16:39:01 +03:00
parent 68dc822121
commit a8cf4c04d4

View file

@ -1095,7 +1095,7 @@ function addFonts(url) {
let family = rule.style.getPropertyValue('font-family'); let family = rule.style.getPropertyValue('font-family');
let font = family.replace(/['"]+/g, '').replace(/ /g, "+"); let font = family.replace(/['"]+/g, '').replace(/ /g, "+");
let weight = rule.style.getPropertyValue('font-weight'); let weight = rule.style.getPropertyValue('font-weight');
if (weight !== "400") font += ":" + weight; if (weight && weight !== "400") font += ":" + weight;
if (fonts.indexOf(font) == -1) { if (fonts.indexOf(font) == -1) {
fonts.push(font); fonts.push(font);
fetched++ fetched++