single-file-core 1.6.26 → 1.6.28

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/helper.js CHANGED
@@ -124,7 +124,8 @@ const DEPRECATED_OPTION_NAMES = {
124
124
  loadDeferredImagesBlockStorage: "loadDeferredContentBlockStorage",
125
125
  loadDeferredImagesKeepZoomLevel: "loadDeferredContentKeepZoomLevel",
126
126
  loadDeferredImagesDispatchScrollEvent: "loadDeferredContentDispatchScrollEvent",
127
- loadDeferredImagesBeforeFrames: "loadDeferredContentBeforeFrames"
127
+ loadDeferredImagesBeforeFrames: "loadDeferredContentBeforeFrames",
128
+ blockAlternativeImages: "removeAlternativeImages"
128
129
  };
129
130
  const addEventListener = (type, listener, options) => globalThis.addEventListener(type, listener, options);
130
131
  const removeEventListener = (type, listener, options) => globalThis.removeEventListener(type, listener, options);
package/core/index.js CHANGED
@@ -1759,7 +1759,8 @@ class Processor {
1759
1759
  this.doc.head.appendChild(styleElement);
1760
1760
  }
1761
1761
  let stylesheetContent = "";
1762
- cssVariables.forEach(({ content, url }, indexResource) => {
1762
+ const variables = Array.from(cssVariables.entries()).sort(([firstIndex], [secondIndex]) => firstIndex - secondIndex);
1763
+ variables.forEach(([indexResource, { content, url }]) => {
1763
1764
  cssVariables.delete(indexResource);
1764
1765
  if (stylesheetContent) {
1765
1766
  stylesheetContent += ";";
@@ -230,7 +230,7 @@ class ProcessorHelperCommon {
230
230
  if (options.saveOriginalURLs && !isDataURL(originSrcset)) {
231
231
  resourceElement.setAttribute("data-sf-original-srcset", originSrcset);
232
232
  }
233
- if (!options.blockImages && !options.blockAlternativeImages) {
233
+ if (!options.blockImages && !options.removeAlternativeImages) {
234
234
  const srcsetValues = await Promise.all(srcset.map(async srcsetValue => {
235
235
  let resourceURL = normalizeURL(srcsetValue.url);
236
236
  if (!testIgnoredPath(resourceURL)) {
package/core/util.js CHANGED
@@ -489,7 +489,7 @@ async function getFetchResponse(resourceURL, options, data, charset, contentType
489
489
  charset = "utf-8";
490
490
  data = new TextDecoder(charset).decode(data);
491
491
  }
492
- data = data.replace(/\ufeff/gi, "");
492
+ data = data.replace(/^\ufeff/, "");
493
493
  }
494
494
  } else if (options.inline) {
495
495
  data = options.asBinary ? helper.EMPTY_RESOURCE : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.6.26",
3
+ "version": "1.6.28",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",