single-file-core 1.2.14 → 1.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/index.js CHANGED
@@ -588,7 +588,11 @@ class Processor {
588
588
  }
589
589
 
590
590
  preProcessPage() {
591
- this.doc.body.querySelectorAll(":not(svg) title, meta, link[href][rel*=\"icon\"]").forEach(element => ((element instanceof (this.options.win && this.options.win.HTMLElement)) || (element instanceof globalThis.HTMLElement)) && this.doc.head.appendChild(element));
591
+ this.doc.body.querySelectorAll(":not(svg) title, meta, link[href][rel*=\"icon\"]").forEach(element => {
592
+ if ((this.options.win && element instanceof this.options.win.HTMLElement) || element instanceof globalThis.HTMLElement) {
593
+ this.doc.head.appendChild(element);
594
+ }
595
+ });
592
596
  if (this.options.images && !this.options.saveRawPage) {
593
597
  this.doc.querySelectorAll("img[" + util.IMAGE_ATTRIBUTE_NAME + "]").forEach(imgElement => {
594
598
  const attributeValue = imgElement.getAttribute(util.IMAGE_ATTRIBUTE_NAME);
@@ -16897,7 +16897,9 @@ async function evalTemplate(template = "", options, util, content, doc, dontRepl
16897
16897
  let urlSubDomains = urlDomainName.substring(0, urlDomainName.lastIndexOf("."));
16898
16898
  const urlDomain = urlDomainName.substring(urlSubDomains.length + 1);
16899
16899
  const urlRoot = urlDomain + "." + urlSuffix;
16900
- if (urlSubDomains == "www") {
16900
+ if (urlSubDomains.startsWith("www.")) {
16901
+ urlSubDomains = urlSubDomains.substring(4);
16902
+ } else if (urlSubDomains == "www") {
16901
16903
  urlSubDomains = "";
16902
16904
  }
16903
16905
  const variables = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.2.14",
3
+ "version": "1.2.16",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",