mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-19 13:11:34 +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));
|
.append($('<span class="note-title">').text(title));
|
||||||
|
|
||||||
if (path.length > 0) {
|
if (path.length > 0) {
|
||||||
$titleWithPath
|
const $notePath = $('<span class="note-path">');
|
||||||
.append($('<span class="note-path">').text(` (${path.join(' / ')})`));
|
|
||||||
}
|
$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;
|
return $titleWithPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user