Sfoglia il codice sorgente

handle SVG elements

Gildas 5 anni fa
parent
commit
f22987f504
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      lib/single-file/single-file-helper.js

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

@@ -155,7 +155,7 @@ this.singlefile.lib.helper = this.singlefile.lib.helper || (() => {
 	}
 
 	function getElementsInfo(win, doc, element, options, data = { usedFonts: new Map(), canvases: [], images: [], posters: [], shadowRoots: [], imports: [], markedElements: [] }, ascendantHidden) {
-		const elements = Array.from(element.childNodes).filter(node => node instanceof win.HTMLElement);
+		const elements = Array.from(element.childNodes).filter(node => (node instanceof win.HTMLElement) || (node instanceof win.SVGElement));
 		elements.forEach(element => {
 			let elementHidden, elementKept, computedStyle;
 			if (!options.autoSaveExternalSave && (options.removeHiddenElements || options.removeUnusedFonts || options.compressHTML)) {