Gildas 7 anni fa
parent
commit
ab96b3f68a
1 ha cambiato i file con 8 aggiunte e 7 eliminazioni
  1. 8 7
      lib/single-file/single-file-core.js

+ 8 - 7
lib/single-file/single-file-core.js

@@ -442,18 +442,19 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 				this.doc.head.querySelector("meta[charset]").remove();
 			}
 			const titleElement = this.doc.querySelector("title");
-			this.options.title = titleElement ? titleElement.textContent.trim() : "";
-			this.options.info = {};
 			const descriptionElement = this.doc.querySelector("meta[name=description]");
-			this.options.info.description = descriptionElement ? descriptionElement.content.trim() : "";
-			this.options.info.lang = this.doc.documentElement.lang;
 			const authorElement = this.doc.querySelector("meta[name=author]");
-			this.options.info.author = authorElement ? authorElement.content.trim() : "";
 			const creatorElement = this.doc.querySelector("meta[name=creator]");
-			this.options.info.creator = creatorElement ? creatorElement.content.trim() : "";
 			const publisherElement = this.doc.querySelector("meta[name=publisher]");
-			this.options.info.publisher = publisherElement ? publisherElement.content.trim() : "";
+			this.options.title = titleElement ? titleElement.textContent.trim() : "";
 			this.options.infobarContent = await DomProcessorHelper.evalTemplate(this.options.infobarTemplate, this.options, null, true);
+			this.options.info = {
+				description: descriptionElement ? descriptionElement.content.trim() : "",
+				lang: this.doc.documentElement.lang,
+				author: authorElement ? authorElement.content.trim() : "",
+				creator: creatorElement ? creatorElement.content.trim() : "",
+				publisher: publisherElement ? publisherElement.content.trim() : ""
+			};
 		}
 
 		preProcessPage() {