Quellcode durchsuchen

don't move SVG title elements into the head

Gildas vor 7 Jahren
Ursprung
Commit
1205918d45
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      lib/single-file/single-file-core.js

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

@@ -18,7 +18,7 @@
  *   along with SingleFile.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/* global CSSRule */
+/* global CSSRule, HTMLElement */
 
 this.SingleFileCore = this.SingleFileCore || (() => {
 
@@ -431,7 +431,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 
 		preProcessPage() {
 			this.doc.querySelectorAll("singlefile-infobar, singlefile-mask").forEach(element => element.remove());
-			this.doc.body.querySelectorAll("title, meta").forEach(element => this.doc.head.appendChild(element));
+			this.doc.body.querySelectorAll(":not(svg) title, meta").forEach(element => element instanceof HTMLElement && this.doc.head.appendChild(element));
 			if (this.options.imageData) {
 				const dataAttributeName = DOM.imagesAttributeName(this.options.sessionId);
 				this.doc.querySelectorAll("img").forEach(imgElement => {