single-file-core 1.5.40 → 1.5.42
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.
|
@@ -16877,10 +16877,10 @@ async function formatFilename(content, doc, options) {
|
|
|
16877
16877
|
if (options.replaceEmojisInFilename) {
|
|
16878
16878
|
EMOJIS.forEach(emoji => (filename = replaceAll(filename, emoji, " _" + EMOJI_NAMES[emoji] + "_ ")));
|
|
16879
16879
|
}
|
|
16880
|
-
const {
|
|
16881
|
-
filename = getValidFilename(filename, filenameReplacedCharacters,
|
|
16880
|
+
const { filenameReplacementCharacter, filenameReplacedCharacters, filenameReplacementCharacters } = options;
|
|
16881
|
+
filename = getValidFilename(filename, filenameReplacedCharacters, filenameReplacementCharacter, filenameReplacementCharacters);
|
|
16882
16882
|
if (!options.backgroundSave) {
|
|
16883
|
-
filename = filename.replace(/\//g,
|
|
16883
|
+
filename = filename.replace(/\//g, filenameReplacementCharacter);
|
|
16884
16884
|
}
|
|
16885
16885
|
if (!options.keepFilename && ((options.filenameMaxLengthUnit == "bytes" && getContentSize(filename) > options.filenameMaxLength) || filename.length > options.filenameMaxLength)) {
|
|
16886
16886
|
const extensionMatch = filename.match(/(\.[^.]{3,4})$/);
|
|
@@ -16944,6 +16944,7 @@ async function evalTemplate(template = "", options, content, doc, context = {})
|
|
|
16944
16944
|
"url-protocol": { getter: () => url.protocol },
|
|
16945
16945
|
"url-search": { getter: () => url.search.substring(1) },
|
|
16946
16946
|
"url-username": { getter: () => url.username },
|
|
16947
|
+
"url-original": { getter: () => options.originalUrl },
|
|
16947
16948
|
"tab-id": { getter: () => String(options.tabId) },
|
|
16948
16949
|
"tab-index": { getter: () => String(options.tabIndex) },
|
|
16949
16950
|
"url-last-segment": { getter: () => decode(getLastSegment(url, options.filenameReplacementCharacter)) },
|