Explorar el Código

make sure image is not empty

Gildas hace 3 años
padre
commit
f4ae8a106a
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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);