From 4fc5ec00ae98cdf15efcad05a194622bd0b03216 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Wed, 24 Jan 2024 18:57:16 +0500 Subject: [PATCH] core: fix extracting internal links --- packages/core/src/utils/content-block.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/utils/content-block.ts b/packages/core/src/utils/content-block.ts index f57827e19..58443c460 100644 --- a/packages/core/src/utils/content-block.ts +++ b/packages/core/src/utils/content-block.ts @@ -26,7 +26,7 @@ export function extractInternalLinks(block: ContentBlock) { const links: InternalLinkWithOffset[] = []; for (const match of matches || []) { - if (!match.index) continue; + if (match.index === undefined) continue; const url = match[1].slice(0, match[1].indexOf("|")); const text = match[1].slice(match[1].indexOf("|") + 1); const link = parseInternalLink(url);