core: fix extracting internal links

This commit is contained in:
Ammar Ahmed
2024-01-24 18:57:16 +05:00
committed by Abdullah Atta
parent 9267433d74
commit 4fc5ec00ae

View File

@@ -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);