diff --git a/src/public/app/services/tree.js b/src/public/app/services/tree.js index 2726036b9..e367c3586 100644 --- a/src/public/app/services/tree.js +++ b/src/public/app/services/tree.js @@ -272,8 +272,16 @@ async function getNoteTitleWithPathAsSuffix(notePath) { const $titleWithPath = $('') .append($('').text(title)); + + $titleWithPath.append(formatPath(path)); + + return $titleWithPath; +} + +function formatPath(path) { + const $notePath = $(''); + if (path.length > 0) { - const $notePath = $(''); $notePath.append($(` ()`)); @@ -286,17 +294,17 @@ async function getNoteTitleWithPathAsSuffix(notePath) { } $notePath.append($(`))`)); - - $titleWithPath.append($notePath); } - - return $titleWithPath; + + return $notePath; } function isNotePathInHiddenSubtree(notePath) { return notePath?.includes("root/_hidden"); } + + export default { resolveNotePath, resolveNotePathToSegments,