From c424ee7bebee23cf7a2e83968cf22916b3e066e1 Mon Sep 17 00:00:00 2001 From: silberengel Date: Sat, 2 Aug 2025 01:58:07 +0200 Subject: [PATCH] fixed wiki links --- src/lib/utils/markup/asciidoctorPostProcessor.ts | 10 ++++++---- src/lib/utils/markup/basicMarkupParser.ts | 5 +++-- src/lib/utils/nostrUtils.ts | 8 ++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/lib/utils/markup/asciidoctorPostProcessor.ts b/src/lib/utils/markup/asciidoctorPostProcessor.ts index dcfa2bc..f2d9318 100644 --- a/src/lib/utils/markup/asciidoctorPostProcessor.ts +++ b/src/lib/utils/markup/asciidoctorPostProcessor.ts @@ -24,9 +24,10 @@ function replaceWikilinks(html: string): string { (_match, target, label) => { const normalized = normalizeDTag(target.trim()); const display = (label || target).trim(); - const url = `./events?d=${normalized}`; + const url = `/events?d=${normalized}`; // Output as a clickable with the [[display]] format and matching link colors - return `${display}`; + // Use onclick to bypass SvelteKit routing and navigate directly + return `${display}`; }, ); } @@ -37,8 +38,9 @@ function replaceWikilinks(html: string): string { function replaceAsciiDocAnchors(html: string): string { return html.replace(/<\/a>/g, (_match, id) => { const normalized = normalizeDTag(id.trim()); - const url = `./events?d=${normalized}`; - return `${id}`; + const url = `/events?d=${normalized}`; + // Use onclick to bypass SvelteKit routing and navigate directly + return `${id}`; }); } diff --git a/src/lib/utils/markup/basicMarkupParser.ts b/src/lib/utils/markup/basicMarkupParser.ts index 953fba5..fd7fd14 100644 --- a/src/lib/utils/markup/basicMarkupParser.ts +++ b/src/lib/utils/markup/basicMarkupParser.ts @@ -160,9 +160,10 @@ function replaceWikilinks(text: string): string { (_match, target, label) => { const normalized = normalizeDTag(target.trim()); const display = (label || target).trim(); - const url = `./events?d=${normalized}`; + const url = `/events?d=${normalized}`; // Output as a clickable with the [[display]] format and matching link colors - return `${display}`; + // Use onclick to bypass SvelteKit routing and navigate directly + return `${display}`; }, ); } diff --git a/src/lib/utils/nostrUtils.ts b/src/lib/utils/nostrUtils.ts index 3d67c57..73fe4e4 100644 --- a/src/lib/utils/nostrUtils.ts +++ b/src/lib/utils/nostrUtils.ts @@ -147,7 +147,7 @@ export function createProfileLink( const escapedText = escapeHtml(displayText || defaultText); // Remove target="_blank" for internal navigation - return `@${escapedText}`; + return `@${escapedText}`; } /** @@ -230,9 +230,9 @@ export async function createProfileLinkWithVerification( const type = nip05.endsWith("edu") ? "edu" : "standard"; switch (type) { case "edu": - return `@${displayIdentifier}${graduationCapSvg}`; + return `@${displayIdentifier}${graduationCapSvg}`; case "standard": - return `@${displayIdentifier}${badgeCheckSvg}`; + return `@${displayIdentifier}${badgeCheckSvg}`; } } /** @@ -244,7 +244,7 @@ function createNoteLink(identifier: string): string { const escapedId = escapeHtml(cleanId); const escapedText = escapeHtml(shortId); - return `${escapedText}`; + return `${escapedText}`; } /**