@@ -251,7 +257,11 @@
-
{getEventTitle(event)}
+ {#if event.kind !== 0 && getEventTitle(event)}
+
{getEventTitle(event)}
+ {:else if event.kind === 0 && profile && profile.name}
+
{profile.name}
+ {/if}
Author:
@@ -283,45 +293,63 @@
Content:
{#if event.kind === 0}
{#if profile}
-
- {#if profile.name}
-
Name: {profile.name}
- {/if}
- {#if profile.display_name}
-
Display Name: {profile.display_name}
- {/if}
- {#if profile.about}
-
About: {profile.about}
- {/if}
- {#if profile.picture}
-
-
Picture:
-

-
- {/if}
- {#if profile.banner}
-
-
Banner:
-

-
- {/if}
- {#if profile.website}
-
- {/if}
- {#if profile.lud16}
-
- Lightning Address: {profile.lud16}
-
- {/if}
- {#if profile.nip05}
-
- NIP-05: {profile.nip05}
-
- {/if}
-
+
+
+ {#if profile.name}
+
+
- Name:
+ - {profile.name}
+
+ {/if}
+ {#if profile.display_name}
+
+
- Display Name:
+ - {profile.display_name}
+
+ {/if}
+ {#if profile.about}
+
+
- About:
+ - {profile.about}
+
+ {/if}
+ {#if profile.picture}
+
+
- Picture:
+
-
+
+
+
+ {/if}
+ {#if profile.banner}
+
+
- Banner:
+
-
+
+
+
+ {/if}
+ {#if profile.website}
+
+ {/if}
+ {#if profile.lud16}
+
+
- Lightning Address:
+ - {profile.lud16}
+
+ {/if}
+ {#if profile.nip05}
+
+
- NIP-05:
+ - {profile.nip05}
+
+ {/if}
+
{:else}
{event.content}
@@ -362,6 +390,16 @@
+ {#if !getEventTitle(event) && !event.content}
+
+ No title or content available for this event.
+
+ {JSON.stringify(event.rawEvent(), null, 2)}
+
+
+ {/if}
+ {:else if event}
+
Fetched event is not a valid NDKEvent. See console for details.
{/if}
diff --git a/src/routes/wiki/+page.svelte b/src/routes/wiki/+page.svelte
index 58abf1b..466de75 100644
--- a/src/routes/wiki/+page.svelte
+++ b/src/routes/wiki/+page.svelte
@@ -10,7 +10,8 @@
import { neventEncode } from '$lib/utils';
import { processNostrIdentifiers } from '$lib/utils/nostrUtils';
import { standardRelays, wikiKind } from '$lib/consts';
-
+ import Pharos from '$lib/parser';
+ import { parseBasicmarkup } from '$lib/utils/markup/basicMarkupParser';
// @ts-ignore Svelte linter false positive: hashtags is used in the template
let { } = $props<{
title: string;
@@ -28,6 +29,7 @@
summary: string;
hashtags: string[];
html: string;
+ content: string;
};
let searchInput = $state('');
@@ -124,6 +126,7 @@
summary: pageData.summary,
hashtags: pageData.hashtags,
html: processedHtml,
+ content: pageData.content,
};
wikiContent = {
title: pageData.title,
@@ -205,6 +208,22 @@
wikiPage = null;
}
});
+
+ (async () => {
+ let html = '';
+ try {
+ const pharos = new Pharos($ndkInstance);
+ pharos.parse('= Test\n\nHello world');
+ const pharosHtml = pharos.getHtml();
+ if (!pharosHtml || pharosHtml.trim() === '') {
+ console.error('Pharos failed to parse AsciiDoc:', '= Test\n\nHello world');
+ }
+ html = await parseBasicmarkup(pharosHtml ?? '');
+ console.log('Test parse result:', html);
+ } catch (err) {
+ console.error('Pharos parse error:', err);
+ }
+ })();
@@ -258,14 +277,15 @@
{/if}
{#if wikiPage.html && wikiPage.html.trim().length > 0}
- {#if event && typeof event.getMatchingTags === 'function'}
- {@html wikiPage.html}
- {:else if event}
-
Fetched event is not a valid NDKEvent. See console for details.
- {/if}
+ {@html wikiPage.html}
{:else}
No content found for this wiki page.
+ {#if wikiPage.content}
+
+ {wikiPage.content}
+
+ {/if}
{JSON.stringify(wikiPage, null, 2)}