From 164816b9f2ee77e52e7e5ede2028b976d96a589c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Sat, 2 Aug 2025 21:16:09 +0200 Subject: [PATCH] Fix parser (cherry picked from commit 3895dce3f18ca145635c0fa2f16d3d93ae2d8c01) --- .../CommonMark/NostrSchemeExtension/NostrSchemeParser.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Util/CommonMark/NostrSchemeExtension/NostrSchemeParser.php b/src/Util/CommonMark/NostrSchemeExtension/NostrSchemeParser.php index 9fc6404..7e66090 100644 --- a/src/Util/CommonMark/NostrSchemeExtension/NostrSchemeParser.php +++ b/src/Util/CommonMark/NostrSchemeExtension/NostrSchemeParser.php @@ -9,6 +9,8 @@ use nostriphant\NIP19\Bech32; use nostriphant\NIP19\Data\NAddr; use nostriphant\NIP19\Data\NEvent; use nostriphant\NIP19\Data\NProfile; +use nostriphant\NIP19\Data\NPub; + class NostrSchemeParser implements InlineParserInterface { @@ -36,7 +38,9 @@ class NostrSchemeParser implements InlineParserInterface switch ($decoded->type) { case 'npub': - $inlineContext->getContainer()->appendChild(new NostrMentionLink(null, $decoded->data)); + /** @var NPub $decoded */ + $decoded = $decoded->data; + $inlineContext->getContainer()->appendChild(new NostrMentionLink(null, $decoded->data->data)); break; case 'nprofile': /** @var NProfile $decodedProfile */