diff --git a/src/helpers/filetreeUtils.js b/src/helpers/filetreeUtils.js index e6590fe31..a771aa7fc 100644 --- a/src/helpers/filetreeUtils.js +++ b/src/helpers/filetreeUtils.js @@ -45,12 +45,6 @@ const sortTree = (unsorted) => { return orderedTree; }; -function toTitleCase(str) { - return str.replace(/\w\S*/g, function (txt) { - return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); - }); -} - function getPermalinkMeta(note, key) { let permalink = "/"; let parts = note.filePathStem.split("/"); @@ -65,7 +59,7 @@ function getPermalinkMeta(note, key) { } if (note.data.tags && note.data.tags.indexOf("gardenEntry") != -1) { permalink = "/"; - } + } if (note.data.title) { name = note.data.title; } @@ -85,8 +79,7 @@ function getPermalinkMeta(note, key) { } else { folders = note.filePathStem .split("notes/")[1] - .split("/") - .map(toTitleCase); + .split("/"); } folders[folders.length - 1]+= ".md"; } catch {