Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(import/spreadsheet): trim extension for CSV
Elian Doran6e67ce5b69a3
diff --git a/packages/trilium-core/src/services/utils/index.spec.ts b/packages/trilium-core/src/services/utils/index.spec.tsindex 5c46b4b0ae..436c013f5e 100644--- a/packages/trilium-core/src/services/utils/index.spec.ts+++ b/packages/trilium-core/src/services/utils/index.spec.ts@@ -303,6 +303,8 @@ describe("#removeFileExtension", () => {[ "w/ 'test.markdown' it should strip '.markdown'", [ "test.markdown" ], "test" ],[ "w/ 'test.html' it should strip '.html'", [ "test.html" ], "test" ],[ "w/ 'test.htm' it should strip '.htm'", [ "test.htm" ], "test" ],+ [ "w/ 'test.xlsx' it should strip '.xlsx'", [ "test.xlsx" ], "test" ],+ [ "w/ 'test.csv' it should strip '.csv'", [ "test.csv" ], "test" ],[ "w/ 'test.zip' it should NOT strip '.zip'", [ "test.zip" ], "test.zip" ]];diff --git a/packages/trilium-core/src/services/utils/index.ts b/packages/trilium-core/src/services/utils/index.tsindex 9b39ba759d..b31bce5cb0 100644--- a/packages/trilium-core/src/services/utils/index.ts+++ b/packages/trilium-core/src/services/utils/index.ts@@ -283,6 +283,7 @@ export function removeFileExtension(filePath: string, mime?: string) {case ".mmd":case ".pdf":case ".xlsx":+ case ".csv":return filePath.substring(0, filePath.length - extension.length);default:return filePath;