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,10 +219,13 @@ function formatDownloadTitle(fileName: string, type: string | null, mime: string
|
|||||||
function removeTextFileExtension(filePath: string) {
|
function removeTextFileExtension(filePath: string) {
|
||||||
const extension = path.extname(filePath).toLowerCase();
|
const extension = path.extname(filePath).toLowerCase();
|
||||||
|
|
||||||
if (extension === '.md' || extension === '.markdown' || extension === '.html') {
|
switch (extension) {
|
||||||
|
case ".md":
|
||||||
|
case ".markdown":
|
||||||
|
case ".html":
|
||||||
|
case ".htm":
|
||||||
return filePath.substr(0, filePath.length - extension.length);
|
return filePath.substr(0, filePath.length - extension.length);
|
||||||
}
|
default:
|
||||||
else {
|
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user