Skip to content

Build your personal knowledge base with Trilium Notes

chore(standalone): fix typecheck after merge

Elian Doranb4710ddbe403
diff --git a/apps/server/src/services/notes.ts b/apps/server/src/services/notes.ts
index f1908c9c93..3a6a3c86c5 100644
--- a/apps/server/src/services/notes.ts
+++ b/apps/server/src/services/notes.ts
@@ -1,3 +1,3 @@
import { note_service } from "@triliumnext/core";
-export { findBookmarks } from "@triliumnext/core";
+export { checkImageAttachments, findBookmarks, saveLinks } from "@triliumnext/core/src/services/notes.js";
export default note_service;
diff --git a/apps/server/src/share/content_renderer.ts b/apps/server/src/share/content_renderer.ts
index 6a3fd1d39b..6e5315b069 100644
--- a/apps/server/src/share/content_renderer.ts
+++ b/apps/server/src/share/content_renderer.ts
@@ -305,7 +305,7 @@ function renderIndex(result: Result) {
for (const childNote of rootNote.getChildNotes()) {
const isExternalLink = childNote.hasLabel("shareExternalLink");
const rawHref = childNote.getLabelValue("shareExternalLink") ?? "";
- const href = isExternalLink ? escapeHtml(sanitizeUrl(rawHref)) : `./${childNote.shareId}`;
+ const href = isExternalLink ? escapeHtml(sanitize.sanitizeUrl(rawHref)) : `./${childNote.shareId}`;
const target = isExternalLink ? `target="_blank" rel="noopener noreferrer"` : "";
result.content += `<li><a class="${childNote.type}" href="${href}" ${target}>${childNote.escapedTitle}</a></li>`;
}
@@ -410,7 +410,7 @@ function handleAttachmentLink(linkEl: HTMLElement, href: string, getNote: GetNot
if (linkedNote) {
const isExternalLink = linkedNote.hasLabel("shareExternalLink");
const rawHref = linkedNote.getLabelValue("shareExternalLink") ?? "";
- const href = isExternalLink ? sanitizeUrl(rawHref) : `./${linkedNote.shareId}`;
+ const href = isExternalLink ? sanitize.sanitizeUrl(rawHref) : `./${linkedNote.shareId}`;
if (href) {
linkEl.setAttribute("href", href);
}
diff --git a/packages/trilium-core/src/services/export/rewrite_links.spec.ts b/packages/trilium-core/src/services/export/rewrite_links.spec.ts
index 712029f3dd..42cc92f108 100644
--- a/packages/trilium-core/src/services/export/rewrite_links.spec.ts
+++ b/packages/trilium-core/src/services/export/rewrite_links.spec.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { rewriteMarkdownContentLinks } from "./rewrite_links.js";
-import type NoteMeta from "../meta/note_meta.js";
+import type { NoteMeta } from "../../meta.js";
function buildNoteMeta(attachments: Array<{ attachmentId: string; dataFileName: string }>): NoteMeta {
return {
diff --git a/packages/trilium-core/src/services/notes.ts b/packages/trilium-core/src/services/notes.ts
index 9816153375..1eef4a8fe9 100644
--- a/packages/trilium-core/src/services/notes.ts
+++ b/packages/trilium-core/src/services/notes.ts
@@ -823,7 +823,7 @@ function saveAttachments(note: BNote, content: string) {
}
-export function saveLinks(note: BNote, content: string | Buffer) {
+export function saveLinks(note: BNote, content: string | Uint8Array) {
if ((note.type !== "text" && note.type !== "relationMap" && !note.isMarkdown()) || (note.isProtected && !protectedSessionService.isProtectedSessionAvailable())) {
return {
forceFrontendReload: false,