瀏覽代碼

don't move SVG title elements into the head

Gildas 7 年之前
父節點
當前提交
1205918d45
共有 1 個文件被更改,包括 2 次插入2 次删除
  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 => {