feat(text): improve display of reference links with bookmarks

This commit is contained in:
Elian Doran
2026-04-18 10:43:14 +03:00
parent 131e10f4fe
commit 7219fc875d
2 changed files with 22 additions and 2 deletions

View File

@@ -434,6 +434,13 @@ async function loadReferenceLinkTitle($el: JQuery<HTMLElement>, href: string | n
const title = await getReferenceLinkTitle(href);
$el.text(title);
if (viewScope?.bookmark) {
$el.append($("<small>").append(
$("<span>").addClass("bx bx-bookmark"),
document.createTextNode(viewScope.bookmark)
));
}
if (note) {
const icon = await getLinkIcon(noteId, viewScope.viewMode);
@@ -459,8 +466,8 @@ async function getReferenceLinkTitle(href: string) {
return attachment ? attachment.title : "[missing attachment]";
}
return note.title;
return note.title;
}
function getReferenceLinkTitleSync(href: string) {
@@ -483,8 +490,12 @@ function getReferenceLinkTitleSync(href: string) {
return attachment ? attachment.title : "[missing attachment]";
}
return note.title;
if (viewScope?.bookmark) {
return `${note.title} - ${viewScope.bookmark}`;
}
return note.title;
}
if (glob.device !== "print") {

View File

@@ -714,6 +714,15 @@ html .note-detail-editable-text :not(figure, .include-note, hr):first-child {
text-decoration: underline;
}
.ck-content a.reference-link small {
margin-left: 0.25em;
opacity: 0.5;
>span {
font-size: 0.7em;
}
}
/*
* Read-only text content
*/