|
|
@@ -37,6 +37,7 @@ this.fontsMinifier = this.fontsMinifier || (() => {
|
|
|
const REGEXP_FONT_FORMAT = /\.([^.?#]+)((\?|#).*?)?$/;
|
|
|
const REGEXP_FONT_FORMAT_VALUE = /format\((.*?)\)\s*,?$/;
|
|
|
const REGEXP_FONT_SRC = /(.*?)\s*,?$/;
|
|
|
+ const EMPTY_URL_SOURCE = "url(\"data:base64,\") format(\"woff\")";
|
|
|
const PSEUDO_ELEMENTS = ["::after", "::before", "::first-line", "::first-letter", ":before", ":after", ":first-line", ":first-letter", "::placeholder", "::selection", "::marker", "::cue", "::slotted", "::spelling-error", "::grammar-error"];
|
|
|
const FONT_WEIGHTS = {
|
|
|
normal: 400,
|
|
|
@@ -223,7 +224,7 @@ this.fontsMinifier = this.fontsMinifier || (() => {
|
|
|
}
|
|
|
return { src: fontSource.match(REGEXP_FONT_SRC)[1], format: fontFormat };
|
|
|
});
|
|
|
- const fontTest = (fontSource, format) => fontSource.format == format;
|
|
|
+ const fontTest = (fontSource, format) => fontSource.src != EMPTY_URL_SOURCE && fontSource.format == format;
|
|
|
let woffFontFound = fontSources.find(fontSource => fontTest(fontSource, "woff2-variations"));
|
|
|
if (!woffFontFound) {
|
|
|
woffFontFound = fontSources.find(fontSource => fontTest(fontSource, "woff2"));
|