mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-17 12:01:41 +08:00
client: format note paths: each segment and delimiter as a separate span
This commit is contained in:
parent
4016c76cc7
commit
79b1d01267
@ -273,10 +273,23 @@ async function getNoteTitleWithPathAsSuffix(notePath) {
|
||||
.append($('<span class="note-title">').text(title));
|
||||
|
||||
if (path.length > 0) {
|
||||
$titleWithPath
|
||||
.append($('<span class="note-path">').text(` (${path.join(' / ')})`));
|
||||
}
|
||||
const $notePath = $('<span class="note-path">');
|
||||
|
||||
$notePath.append($(`<span class="path-bracket">(</span>)`));
|
||||
|
||||
for (let segmentIndex = 0; segmentIndex < path.length; segmentIndex++) {
|
||||
$notePath.append($(`<span>`).text(path[segmentIndex]));
|
||||
|
||||
if (segmentIndex < path.length - 1) {
|
||||
$notePath.append($(`<span class="path-bracket">`).text(" / "));
|
||||
}
|
||||
}
|
||||
|
||||
$notePath.append($(`<span class="path-wrapper">)</span>)`));
|
||||
|
||||
$titleWithPath.append($notePath);
|
||||
}
|
||||
|
||||
return $titleWithPath;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user