From 1e86d8503516573fa9c60bc3921346956f103897 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 20 Nov 2025 14:39:36 +0200 Subject: [PATCH] fix(share): some reference links appear with [missing note] --- apps/server/src/share/content_renderer.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/server/src/share/content_renderer.ts b/apps/server/src/share/content_renderer.ts index ec3893ee5..86ee0abc8 100644 --- a/apps/server/src/share/content_renderer.ts +++ b/apps/server/src/share/content_renderer.ts @@ -318,13 +318,13 @@ function renderText(result: Result, note: SNote | BNote) { continue; } - if (href?.startsWith("#")) { - handleAttachmentLink(linkEl, href, getNote, getAttachment); - } - if (linkEl.classList.contains("reference-link")) { cleanUpReferenceLinks(linkEl); } + + if (href?.startsWith("#")) { + handleAttachmentLink(linkEl, href, getNote, getAttachment); + } } // Apply syntax highlight. @@ -400,6 +400,7 @@ function cleanUpReferenceLinks(linkEl: HTMLElement) { const noteId = href.split("/").at(-1); const note = noteId ? shaca.getNote(noteId) : undefined; if (!note) { + console.warn("Unable to find note ", noteId); linkEl.innerHTML = "[missing note]"; } else if (note.isProtected) { linkEl.innerHTML = "[protected]";