From 79b1d01267431b44101ade2e6b79fc3f1ee9f2b3 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Thu, 5 Dec 2024 02:06:32 +0200 Subject: [PATCH] client: format note paths: each segment and delimiter as a separate span --- src/public/app/services/tree.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/public/app/services/tree.js b/src/public/app/services/tree.js index 3a3907585..a721b76e7 100644 --- a/src/public/app/services/tree.js +++ b/src/public/app/services/tree.js @@ -273,10 +273,23 @@ async function getNoteTitleWithPathAsSuffix(notePath) { .append($('').text(title)); if (path.length > 0) { - $titleWithPath - .append($('').text(` (${path.join(' / ')})`)); - } + const $notePath = $(''); + + $notePath.append($(`()`)); + for (let segmentIndex = 0; segmentIndex < path.length; segmentIndex++) { + $notePath.append($(``).text(path[segmentIndex])); + + if (segmentIndex < path.length - 1) { + $notePath.append($(``).text(" / ")); + } + } + + $notePath.append($(`))`)); + + $titleWithPath.append($notePath); + } + return $titleWithPath; }