From 1ed8a9eaca75758892c85fcbe48732fb5b0f71cd Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Wed, 24 Jan 2024 18:57:34 +0500 Subject: [PATCH] core: parse internal link from href --- packages/core/src/utils/internal-link.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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( 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 {