Selaa lähdekoodia

reùove element if needed

Gildas 7 vuotta sitten
vanhempi
sitoutus
c8fdd192c5
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      lib/single-file/single-file-core.js

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

@@ -1127,7 +1127,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 						if (DomUtil.testValidURL(resourceURL, baseURI, options.url)) {
 							const { content, indexResource, duplicate } = await batchRequest.addURL(resourceURL);
 							if (removeElementIfMissing && content == EMPTY_DATA_URI) {
-								resourceElement.setAttribute(attributeName, content);
+								resourceElement.remove();
 							} else {
 								if (content.startsWith(prefixDataURI) || content.startsWith(PREFIX_DATA_URI_NO_MIMETYPE) || content.match(PREFIX_DATA_URI_OCTET_STREAM)) {
 									const isSVG = content.startsWith(PREFIX_DATA_URI_IMAGE_SVG);