single-file-core 1.2.2 → 1.2.4

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.
@@ -69,7 +69,7 @@ class ProcessorHelperCommon {
69
69
 
70
70
  async getStylesheetContent(resourceURL, options) {
71
71
  const content = await util.getContent(resourceURL, {
72
- inline: options.inline,
72
+ inline: !options.compressContent,
73
73
  maxResourceSize: options.maxResourceSize,
74
74
  maxResourceSizeEnabled: options.maxResourceSizeEnabled,
75
75
  validateTextContentType: true,
@@ -85,7 +85,7 @@ class ProcessorHelperCommon {
85
85
  if (!(matchCharsetEquals(content.data, content.charset) || matchCharsetEquals(content.data, options.charset))) {
86
86
  options = Object.assign({}, options, { charset: getCharset(content.data) });
87
87
  return util.getContent(resourceURL, {
88
- inline: options.inline,
88
+ inline: !options.compressContent,
89
89
  maxResourceSize: options.maxResourceSize,
90
90
  maxResourceSizeEnabled: options.maxResourceSizeEnabled,
91
91
  validateTextContentType: true,
@@ -270,7 +270,10 @@ function parseFamilyNames(fontFamilyNameTokenData, fontFamilyNames) {
270
270
  } else if (nextToken.data.type == "String") {
271
271
  fontFamilyNames.push(helper.normalizeFontFamily(nextToken.data.value));
272
272
  nextToken = nextToken.next;
273
- } else if (nextToken.data.type == "Operator" && nextToken.data.value == ",") {
273
+ } else if (nextToken.data.type == "Number") {
274
+ fontFamilyNames.push(helper.normalizeFontFamily(String(nextToken.data.value)));
275
+ nextToken = nextToken.next;
276
+ } else {
274
277
  nextToken = nextToken.next;
275
278
  }
276
279
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",
@@ -28,7 +28,7 @@ export {
28
28
  };
29
29
 
30
30
  async function display(document, docContent, { disableFramePointerEvents } = {}) {
31
- const DISABLED_NOSCRIPT_ATTRIBUTE_NAME = "data-single-filez-disabled-noscript";
31
+ const DISABLED_NOSCRIPT_ATTRIBUTE_NAME = "data-single-file-disabled-noscript";
32
32
  const doc = (new DOMParser()).parseFromString(docContent, "text/html");
33
33
  doc.querySelectorAll("noscript:not([" + DISABLED_NOSCRIPT_ATTRIBUTE_NAME + "])").forEach(element => {
34
34
  element.setAttribute(DISABLED_NOSCRIPT_ATTRIBUTE_NAME, element.innerHTML);
@@ -80,8 +80,8 @@ async function process(pageData, options) {
80
80
  pageContent += "<div id='sfz-wait-message'>Please wait...</div>";
81
81
  pageContent += "<div id='sfz-error-message'><strong>Error</strong>: Cannot open the page from the filesystem.";
82
82
  pageContent += "<ul style='line-height:20px;'>";
83
- pageContent += "<li style='margin-bottom:10px'><strong>Chrome</strong>: Install <a href='https://chrome.google.com/webstore/detail/singlefile/mpiodijhokgodhhofbcjdecpffjipkle'>SingleFile</a> and enable the option \"Allow access to file URLs\" in the details page of the extension (chrome://extensions/?id=offkdfbbigofcgdokjemgjpdockaafjg).</li>";
84
- pageContent += "<li style='margin-bottom:10px'><strong>Microsoft Edge</strong>: Install <a href='https://microsoftedge.microsoft.com/addons/detail/singlefile/efnbkdcfmcmnhlkaijjjmhjjgladedno'>SingleFile</a> and enable the option \"Allow access to file URLs\" in the details page of the extension (edge://extensions/?id=gofneaifncimeglaecpnanbnmnpfjekk).</li>";
83
+ pageContent += "<li style='margin-bottom:10px'><strong>Chrome</strong>: Install <a href='https://chrome.google.com/webstore/detail/singlefile/mpiodijhokgodhhofbcjdecpffjipkle'>SingleFile</a> and enable the option \"Allow access to file URLs\" in the details page of the extension (chrome://extensions/?id=mpiodijhokgodhhofbcjdecpffjipkle).</li>";
84
+ pageContent += "<li style='margin-bottom:10px'><strong>Microsoft Edge</strong>: Install <a href='https://microsoftedge.microsoft.com/addons/detail/singlefile/efnbkdcfmcmnhlkaijjjmhjjgladedno'>SingleFile</a> and enable the option \"Allow access to file URLs\" in the details page of the extension (edge://extensions/?id=efnbkdcfmcmnhlkaijjjmhjjgladedno).</li>";
85
85
  pageContent += "<li><strong>Safari</strong>: Select \"Security > Disable Local File Restrictions\" in the \"Develop > Developer settings\" menu.</li></ul></div>";
86
86
  if (options.insertTextBody) {
87
87
  const doc = (new DOMParser()).parseFromString(pageData.content, "text/html");