Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: parse internal link from href

Ammar Ahmedef6c4bb6fb41
diff --git a/packages/core/src/utils/internal-link.ts b/packages/core/src/utils/internal-link.ts
index 7f6fffd80..b247c9340 100644
--- a/packages/core/src/utils/internal-link.ts
+++ b/packages/core/src/utils/internal-link.ts
@@ -53,8 +53,9 @@ export function createInternalLink<T extends InternalLinkType>(
export function parseInternalLink(link: string): InternalLink | undefined {
const url = new URL(link);
+
if (url.protocol !== "nn:") return;
- const [type, id] = url.pathname.split("/").slice(2);
+ const [type, id] = url.href.split("?")[0].split("/").slice(2);
if (!type || !id || !isValidInternalType(type)) return;
return {