single-file-core 1.4.6 → 1.4.7

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
@@ -940,7 +940,9 @@ class Processor {
940
940
  setInputValues() {
941
941
  this.doc.querySelectorAll("input:not([type=radio]):not([type=checkbox])").forEach(input => {
942
942
  const value = input.getAttribute(util.INPUT_VALUE_ATTRIBUTE_NAME);
943
- input.setAttribute("value", value || "");
943
+ if (value != null) {
944
+ input.setAttribute("value", value);
945
+ }
944
946
  });
945
947
  this.doc.querySelectorAll("input[type=radio], input[type=checkbox]").forEach(input => {
946
948
  const value = input.getAttribute(util.INPUT_VALUE_ATTRIBUTE_NAME);
@@ -950,7 +952,9 @@ class Processor {
950
952
  });
951
953
  this.doc.querySelectorAll("textarea").forEach(textarea => {
952
954
  const value = textarea.getAttribute(util.INPUT_VALUE_ATTRIBUTE_NAME);
953
- textarea.textContent = value || "";
955
+ if (value != null) {
956
+ textarea.textContent = value;
957
+ }
954
958
  });
955
959
  this.doc.querySelectorAll("select").forEach(select => {
956
960
  select.querySelectorAll("option").forEach(option => {
@@ -197,11 +197,12 @@ function getProcessorHelperClass(utilInstance) {
197
197
  if (!(matchCharsetEquals(content.data, content.charset) || matchCharsetEquals(content.data, options.charset))) {
198
198
  options = Object.assign({}, options, { charset: getCharset(content.data) });
199
199
  await this.resolveLinkStylesheetURLs(stylesheetInfo, element, resourceURL, baseURI, options, workStylesheet, resources, stylesheets);
200
+ } else {
201
+ resourceURL = content.resourceURL;
202
+ content.data = getUpdatedResourceContent(content.resourceURL, options) || content.data;
203
+ stylesheetInfo.stylesheet = cssTree.parse(content.data, { context: "stylesheet", parseCustomProperty: true });
204
+ await this.resolveImportURLs(stylesheetInfo, resourceURL, options, workStylesheet, resources, stylesheets);
200
205
  }
201
- resourceURL = content.resourceURL;
202
- content.data = getUpdatedResourceContent(content.resourceURL, options) || content.data;
203
- stylesheetInfo.stylesheet = cssTree.parse(content.data, { context: "stylesheet", parseCustomProperty: true });
204
- await this.resolveImportURLs(stylesheetInfo, resourceURL, options, workStylesheet, resources, stylesheets);
205
206
  }
206
207
  }
207
208
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",