single-file-core 1.0.39 → 1.0.40

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/.eslintrc.js CHANGED
File without changes
package/LICENSE CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/modules/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",
File without changes
File without changes
File without changes
File without changes
@@ -791,14 +791,16 @@ class Processor {
791
791
  replaceInvalidElements() {
792
792
  this.doc.querySelectorAll("template[" + util.INVALID_ELEMENT_ATTRIBUTE_NAME + "]").forEach(templateElement => {
793
793
  const placeHolderElement = this.doc.createElement("span");
794
- const originalElement = templateElement.content.firstChild;
795
- if (originalElement) {
796
- if (originalElement.hasAttributes()) {
797
- Array.from(originalElement.attributes).forEach(attribute => placeHolderElement.setAttribute(attribute.name, attribute.value));
794
+ if (templateElement.content) {
795
+ const originalElement = templateElement.content.firstChild;
796
+ if (originalElement) {
797
+ if (originalElement.hasAttributes()) {
798
+ Array.from(originalElement.attributes).forEach(attribute => placeHolderElement.setAttribute(attribute.name, attribute.value));
799
+ }
800
+ originalElement.childNodes.forEach(childNode => placeHolderElement.appendChild(childNode.cloneNode(true)));
798
801
  }
799
- originalElement.childNodes.forEach(childNode => placeHolderElement.appendChild(childNode.cloneNode(true)));
802
+ templateElement.replaceWith(placeHolderElement);
800
803
  }
801
- templateElement.replaceWith(placeHolderElement);
802
804
  });
803
805
  }
804
806
 
File without changes
File without changes
File without changes
File without changes
File without changes
package/single-file.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/vendor/index.js CHANGED
File without changes
File without changes