mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-09 17:52:32 +08:00
client: format the note paths displayed in the note links
This commit is contained in:
parent
0588c91d1d
commit
2b36bde9a9
@ -102,15 +102,15 @@ async function createLink(notePath, options = {}) {
|
||||
$container.append($noteLink);
|
||||
|
||||
if (showNotePath) {
|
||||
const resolvedNotePathSegments = await treeService.resolveNotePathToSegments(notePath);
|
||||
const resolvedPathSegments = await treeService.resolveNotePathToSegments(notePath);
|
||||
resolvedPathSegments.pop(); // Remove last element
|
||||
|
||||
if (resolvedNotePathSegments) {
|
||||
resolvedNotePathSegments.pop(); // remove last element
|
||||
const resolvedPath = resolvedPathSegments.join("/");
|
||||
const pathSegments = await treeService.getNotePathTitleComponents(resolvedPath);
|
||||
|
||||
const parentNotePath = resolvedNotePathSegments.join("/").trim();
|
||||
|
||||
if (parentNotePath) {
|
||||
$container.append($("<small>").text(` (${await treeService.getNotePathTitle(parentNotePath)})`));
|
||||
if (pathSegments) {
|
||||
if (pathSegments.length) {
|
||||
$container.append($("<small>").append(treeService.formatNotePath(pathSegments)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -310,6 +310,7 @@ export default {
|
||||
resolveNotePathToSegments,
|
||||
getParentProtectedStatus,
|
||||
getNotePath,
|
||||
getNotePathTitleComponents,
|
||||
getNoteIdFromUrl,
|
||||
getNoteIdAndParentIdFromUrl,
|
||||
getBranchIdFromUrl,
|
||||
|
Loading…
x
Reference in New Issue
Block a user