mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-28 16:01:32 +08:00
server: Trim .htm when importing zip (closes #500)
This commit is contained in:
parent
d4956ad3a2
commit
4ad725842e
@ -219,11 +219,14 @@ function formatDownloadTitle(fileName: string, type: string | null, mime: string
|
||||
function removeTextFileExtension(filePath: string) {
|
||||
const extension = path.extname(filePath).toLowerCase();
|
||||
|
||||
if (extension === '.md' || extension === '.markdown' || extension === '.html') {
|
||||
return filePath.substr(0, filePath.length - extension.length);
|
||||
}
|
||||
else {
|
||||
return filePath;
|
||||
switch (extension) {
|
||||
case ".md":
|
||||
case ".markdown":
|
||||
case ".html":
|
||||
case ".htm":
|
||||
return filePath.substr(0, filePath.length - extension.length);
|
||||
default:
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user