mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
Get file extension before clipping file name (#2562)
I think this fixes https://github.com/zadam/trilium/issues/2131
This commit is contained in:
parent
4933b901f6
commit
64172a7f6b
@ -52,13 +52,13 @@ function exportToZip(taskContext, branch, format, res) {
|
|||||||
function getDataFileName(note, baseFileName, existingFileNames) {
|
function getDataFileName(note, baseFileName, existingFileNames) {
|
||||||
let fileName = baseFileName;
|
let fileName = baseFileName;
|
||||||
|
|
||||||
|
let existingExtension = path.extname(fileName).toLowerCase();
|
||||||
|
let newExtension;
|
||||||
|
|
||||||
if (fileName.length > 30) {
|
if (fileName.length > 30) {
|
||||||
fileName = fileName.substr(0, 30);
|
fileName = fileName.substr(0, 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
let existingExtension = path.extname(fileName).toLowerCase();
|
|
||||||
let newExtension;
|
|
||||||
|
|
||||||
// following two are handled specifically since we always want to have these extensions no matter the automatic detection
|
// following two are handled specifically since we always want to have these extensions no matter the automatic detection
|
||||||
// and/or existing detected extensions in the note name
|
// and/or existing detected extensions in the note name
|
||||||
if (note.type === 'text' && format === 'markdown') {
|
if (note.type === 'text' && format === 'markdown') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user