mirror of
https://github.com/zadam/trilium.git
synced 2025-11-21 08:04:24 +01:00
fix(share): some reference links appear with [missing note]
This commit is contained in:
parent
abfc2fea3e
commit
1e86d85035
@ -318,13 +318,13 @@ function renderText(result: Result, note: SNote | BNote) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (href?.startsWith("#")) {
|
|
||||||
handleAttachmentLink(linkEl, href, getNote, getAttachment);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (linkEl.classList.contains("reference-link")) {
|
if (linkEl.classList.contains("reference-link")) {
|
||||||
cleanUpReferenceLinks(linkEl);
|
cleanUpReferenceLinks(linkEl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (href?.startsWith("#")) {
|
||||||
|
handleAttachmentLink(linkEl, href, getNote, getAttachment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply syntax highlight.
|
// Apply syntax highlight.
|
||||||
@ -400,6 +400,7 @@ function cleanUpReferenceLinks(linkEl: HTMLElement) {
|
|||||||
const noteId = href.split("/").at(-1);
|
const noteId = href.split("/").at(-1);
|
||||||
const note = noteId ? shaca.getNote(noteId) : undefined;
|
const note = noteId ? shaca.getNote(noteId) : undefined;
|
||||||
if (!note) {
|
if (!note) {
|
||||||
|
console.warn("Unable to find note ", noteId);
|
||||||
linkEl.innerHTML = "[missing note]";
|
linkEl.innerHTML = "[missing note]";
|
||||||
} else if (note.isProtected) {
|
} else if (note.isProtected) {
|
||||||
linkEl.innerHTML = "[protected]";
|
linkEl.innerHTML = "[protected]";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user