single-file-core 1.0.24 → 1.0.26
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 = parentNode.tagName.toLowerCase();
|
|
95
95
|
}
|
|
96
96
|
if (!parentTagName || TEXT_NODE_TAGS.includes(parentTagName)) {
|
|
97
|
-
if (parentTagName == "script") {
|
|
97
|
+
if (parentTagName == "script" || parentTagName == "style") {
|
|
98
98
|
return textNode.textContent.replace(/<\//gi, "<\\/").replace(/\/>/gi, "\\/>");
|
|
99
99
|
}
|
|
100
100
|
return textNode.textContent;
|
package/package.json
CHANGED
package/single-file-core.js
CHANGED
|
@@ -533,7 +533,7 @@ class Processor {
|
|
|
533
533
|
if (!this.options.backgroundSave) {
|
|
534
534
|
filename = filename.replace(/\//g, replacementCharacter);
|
|
535
535
|
}
|
|
536
|
-
if (!this.options.
|
|
536
|
+
if (!this.options.keepFilename &&
|
|
537
537
|
((this.options.filenameMaxLengthUnit == "bytes" && util.getContentSize(filename) > this.options.filenameMaxLength) || (filename.length > this.options.filenameMaxLength))) {
|
|
538
538
|
const extensionMatch = filename.match(/(\.[^.]{3,4})$/);
|
|
539
539
|
const extension = extensionMatch && extensionMatch[0] && extensionMatch[0].length > 1 ? extensionMatch[0] : "";
|
package/single-file-helper.js
CHANGED
|
@@ -138,7 +138,7 @@ function preProcessDoc(doc, win, options) {
|
|
|
138
138
|
const invalidElements = new Map();
|
|
139
139
|
let elementsInfo;
|
|
140
140
|
if (win && doc.documentElement) {
|
|
141
|
-
doc.querySelectorAll("button button, a a
|
|
141
|
+
doc.querySelectorAll("button button, a a").forEach(element => {
|
|
142
142
|
const placeHolderElement = doc.createElement("template");
|
|
143
143
|
placeHolderElement.setAttribute(INVALID_ELEMENT_ATTRIBUTE_NAME, "");
|
|
144
144
|
placeHolderElement.content.appendChild(element.cloneNode(true));
|