|
|
|
@ -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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|