single-file-core 1.5.11 → 1.5.12

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.
@@ -94,7 +94,7 @@ function serializeTextNode(textNode) {
94
94
  parentTagName = getTagName(parentNode);
95
95
  }
96
96
  if (!parentTagName || TEXT_NODE_TAGS.includes(parentTagName)) {
97
- if (parentTagName == "SCRIPT" || parentTagName == "STYLE") {
97
+ if ((parentTagName == "SCRIPT" && (!parentNode.type || parentNode.type == "text/javascript")) || parentTagName == "STYLE") {
98
98
  return textNode.textContent.replace(/<\//gi, "<\\/").replace(/\/>/gi, "\\/>");
99
99
  }
100
100
  return textNode.textContent;
@@ -180,5 +180,5 @@ function startsWithSpaceChar(textContent) {
180
180
  }
181
181
 
182
182
  function getTagName(element) {
183
- return element.tagName && element.tagName.toUpperCase();
183
+ return element.tagName && element.tagName.toUpperCase();
184
184
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.5.11",
3
+ "version": "1.5.12",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",