Procházet zdrojové kódy

make sure image is not empty

Gildas před 3 roky
rodič
revize
f4ae8a106a
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      src/single-file/single-file-core.js

+ 1 - 1
src/single-file/single-file-core.js

@@ -2006,7 +2006,7 @@ class ProcessorHelper {
 							}
 							if (removeElementIfMissing && content == EMPTY_DATA_URI) {
 								resourceElement.remove();
-							} else {
+							} else if (content !== EMPTY_DATA_URI) {
 								const forbiddenPrefixFound = PREFIXES_FORBIDDEN_DATA_URI.filter(prefixDataURI => content.startsWith(prefixDataURI)).length;
 								if (!forbiddenPrefixFound) {
 									const isSVG = content.startsWith(PREFIX_DATA_URI_IMAGE_SVG);