Explorar o código

prevent removing SVG sprites when saving selected content

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
739db5beba
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      lib/single-file/single-file-core.js

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

@@ -976,7 +976,8 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 				let elementFound = false;
 				Array.from(parentElement.childNodes).forEach(node => {
 					elementFound = elementFound || (node == element);
-					if (node != element && node.tagName != "STYLE" && node.tagName != "LINK") {
+					const tagName = node.tagName && node.tagName.toLowerCase();
+					if (node != element && tagName != "svg" && tagName != "style" && tagName != "link") {
 						if (elementFound) {
 							node.remove();
 						} else {