Explorar o código

fixed issue when the ID is already used in the document

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

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

@@ -1088,7 +1088,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 									const symbolElement = svgDoc.querySelector(hashMatch[0]);
 									if (symbolElement) {
 										resourceElement.setAttribute(attributeName, hashMatch[0]);
-										resourceElement.parentElement.appendChild(symbolElement);
+										resourceElement.parentElement.insertBefore(symbolElement, resourceElement.parentElement.firstChild);
 									}
 								} else {
 									resourceElement.setAttribute(attributeName, "data:image/svg+xml," + content);