Преглед на файлове

fixed issue when the ID is already used in the document

Gildas преди 7 години
родител
ревизия
8f8b635f3c
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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);