single-file-core 1.2.5 → 1.2.6
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.
|
@@ -1973,6 +1973,7 @@ async function evalTemplate(template = "", options, util, content, dontReplaceSl
|
|
|
1973
1973
|
template = await evalTemplateVariable(template, "bookmark-pathname", () => bookmarkFolder, dontReplaceSlash === undefined ? true : dontReplaceSlash, options.filenameReplacementCharacter);
|
|
1974
1974
|
template = await evalTemplateVariable(template, "bookmark-pathname-flat", () => bookmarkFolder, false, options.filenameReplacementCharacter);
|
|
1975
1975
|
template = await evalTemplateVariable(template, "profile-name", () => options.profileName, dontReplaceSlash, options.filenameReplacementCharacter);
|
|
1976
|
+
template = await evalTemplateVariable(template, "filename-extension", () => getFilenameExtension(options), dontReplaceSlash, options.filenameReplacementCharacter);
|
|
1976
1977
|
return template.trim();
|
|
1977
1978
|
|
|
1978
1979
|
function decode(value) {
|
|
@@ -2102,3 +2103,19 @@ function truncateText(content, maxSize) {
|
|
|
2102
2103
|
reader.addEventListener("error", reject, false);
|
|
2103
2104
|
});
|
|
2104
2105
|
}
|
|
2106
|
+
|
|
2107
|
+
function getFilenameExtension(options) {
|
|
2108
|
+
if (options.compressContent) {
|
|
2109
|
+
if (options.selfExtractingArchive) {
|
|
2110
|
+
if (options.extractDataFromPage) {
|
|
2111
|
+
return "u.zip.html";
|
|
2112
|
+
} else {
|
|
2113
|
+
return "zip.html";
|
|
2114
|
+
}
|
|
2115
|
+
} else {
|
|
2116
|
+
return "zip";
|
|
2117
|
+
}
|
|
2118
|
+
} else {
|
|
2119
|
+
return "html";
|
|
2120
|
+
}
|
|
2121
|
+
}
|