mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 18:39:22 +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);
|
$container.append($noteLink);
|
||||||
|
|
||||||
if (showNotePath) {
|
if (showNotePath) {
|
||||||
const resolvedNotePathSegments = await treeService.resolveNotePathToSegments(notePath);
|
const resolvedPathSegments = await treeService.resolveNotePathToSegments(notePath);
|
||||||
|
resolvedPathSegments.pop(); // Remove last element
|
||||||
|
|
||||||
if (resolvedNotePathSegments) {
|
const resolvedPath = resolvedPathSegments.join("/");
|
||||||
resolvedNotePathSegments.pop(); // remove last element
|
const pathSegments = await treeService.getNotePathTitleComponents(resolvedPath);
|
||||||
|
|
||||||
const parentNotePath = resolvedNotePathSegments.join("/").trim();
|
if (pathSegments) {
|
||||||
|
if (pathSegments.length) {
|
||||||
if (parentNotePath) {
|
$container.append($("<small>").append(treeService.formatNotePath(pathSegments)));
|
||||||
$container.append($("<small>").text(` (${await treeService.getNotePathTitle(parentNotePath)})`));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -310,6 +310,7 @@ export default {
|
|||||||
resolveNotePathToSegments,
|
resolveNotePathToSegments,
|
||||||
getParentProtectedStatus,
|
getParentProtectedStatus,
|
||||||
getNotePath,
|
getNotePath,
|
||||||
|
getNotePathTitleComponents,
|
||||||
getNoteIdFromUrl,
|
getNoteIdFromUrl,
|
||||||
getNoteIdAndParentIdFromUrl,
|
getNoteIdAndParentIdFromUrl,
|
||||||
getBranchIdFromUrl,
|
getBranchIdFromUrl,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user