single-file-core 1.5.59 → 1.5.60

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
@@ -106,6 +106,7 @@ export {
106
106
  digest,
107
107
  getValidFilename,
108
108
  parseDocContent,
109
+ markInvalidNesting,
109
110
  fixInvalidNesting,
110
111
  ON_BEFORE_CAPTURE_EVENT_NAME,
111
112
  ON_AFTER_CAPTURE_EVENT_NAME,
@@ -332,7 +333,7 @@ function fixInvalidNesting(document, NESTING_TRACK_ID_ATTRIBUTE_NAME, preventCle
332
333
  }
333
334
  });
334
335
  if (!preventCleanup) {
335
- Object.keys(trackIds).forEach(id => trackIds[id].removeAttribute(NESTING_TRACK_ID_ATTRIBUTE_NAME));
336
+ document.querySelectorAll("[" + NESTING_TRACK_ID_ATTRIBUTE_NAME + "]").forEach(element => element.removeAttribute(NESTING_TRACK_ID_ATTRIBUTE_NAME));
336
337
  }
337
338
 
338
339
  function buildTrackIdMap(element) {
package/core/util.js CHANGED
@@ -129,8 +129,11 @@ function getInstance(utilOptions) {
129
129
  return doc;
130
130
  }
131
131
  },
132
- fixInvalidNesting(doc) {
133
- helper.fixInvalidNesting(doc, helper.NESTING_TRACK_ID_ATTRIBUTE_NAME, true);
132
+ fixInvalidNesting(doc, preventCleanup = true) {
133
+ helper.fixInvalidNesting(doc, helper.NESTING_TRACK_ID_ATTRIBUTE_NAME, preventCleanup);
134
+ },
135
+ markInvalidNesting(doc) {
136
+ helper.markInvalidNesting(doc, helper.NESTING_TRACK_ID_ATTRIBUTE_NAME);
134
137
  },
135
138
  getFixInvalidNestingSource() {
136
139
  return helper.fixInvalidNesting.toString().replace(/\s+/g, " ");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.5.59",
3
+ "version": "1.5.60",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",
@@ -46,6 +46,12 @@ const helper = {
46
46
  displayIcon(doc, useShadowRoot, options = {}) {
47
47
  return infobar.displayIcon(doc, useShadowRoot, options);
48
48
  },
49
+ fixInvalidNesting(document, preventCleanup = false) {
50
+ return util.fixInvalidNesting(document, preventCleanup);
51
+ },
52
+ markInvalidNesting(document) {
53
+ return util.markInvalidNesting(document);
54
+ },
49
55
  zip,
50
56
  extract,
51
57
  display,